On Sat, Jun 30, 2018 at 2:11 PM, Colin Ian King
static analysis with CoverityScan detected an issue with the following
Author: Christoph Hellwig <hch(a)lst.de>
Date: Fri Dec 29 08:54:05 2017 +0100
memremap: change devm_memremap_pages interface to use struct dev_pagemap
CID 1464431 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling devm_add_action without checking return value (as
is done elsewhere 33 out of 35 times).
249 devm_add_action(dev, devm_memremap_pages_release, pgmap);
251 return __va(res->start);
devm_add_action can fail and return -ENOMEM because it calls
devres_alloc which can fail in an out of memory situation. So I believe
it may be pertinent to add a -ENOMEM check and clean up appropriately.
I'm not sure of the correct way to perform the error clean up, so I'm
sending this report instead of a fix.
Thanks for this. We have a fix pending here looking to go through Andrew's tree.