commit | c3c8c051df3ee5042dd91593593a8b0e008f4c85 | [log] [tgz] |
---|---|---|
author | Dan Carpenter <dan.carpenter@oracle.com> | Fri May 14 17:27:15 2021 +0300 |
committer | Miquel Raynal <miquel.raynal@bootlin.com> | Wed May 26 10:41:43 2021 +0200 |
tree | 7368d2077ca6acf1befa4f70a0c40b6bb74a8834 | |
parent | bc8e157fdb466536557b97b6c0df6d7b46a2b91b [diff] |
mtd: core: Potential NULL dereference in mtd_otp_size() If kmalloc() fails then it could lead to a NULL dereference. Check and return -ENOMEM on error. Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Michael Walle <michael@walle.cc> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/YJ6Iw3iNvGycAWV6@mwanda