hwmon: (asus-ec-sensors) Add checks for devm_kcalloc
authorYuan Can <yuancan@huawei.com>
Fri, 25 Nov 2022 01:43:29 +0000 (01:43 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 1 Dec 2022 17:20:55 +0000 (09:20 -0800)
commit9bdc112be727cf1ba65be79541147f960c3349d8
tree80f3242643a1c11dcd89dd5bce0a689850fb85e9
parent7dec14537c5906b8bf40fd6fd6d9c3850f8df11d
hwmon: (asus-ec-sensors) Add checks for devm_kcalloc

As the devm_kcalloc may return NULL, the return value needs to be checked
to avoid NULL poineter dereference.

Fixes: d0ddfd241e57 ("hwmon: (asus-ec-sensors) add driver for ASUS EC")
Signed-off-by: Yuan Can <yuancan@huawei.com>
Link: https://lore.kernel.org/r/20221125014329.121560-1-yuancan@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/asus-ec-sensors.c