summaryrefslogtreecommitdiff
path: root/drivers/hwmon/asus-ec-sensors.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/asus-ec-sensors.c')
-rw-r--r--drivers/hwmon/asus-ec-sensors.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index 81e688975c6a..a901e4e33d81 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -938,6 +938,8 @@ static int asus_ec_probe(struct platform_device *pdev)
ec_data->nr_sensors = hweight_long(ec_data->board_info->sensors);
ec_data->sensors = devm_kcalloc(dev, ec_data->nr_sensors,
sizeof(struct ec_sensor), GFP_KERNEL);
+ if (!ec_data->sensors)
+ return -ENOMEM;
status = setup_lock_data(dev);
if (status) {