From: Qianggui Song Date: Wed, 11 Sep 2019 09:22:50 +0000 (+0800) Subject: ir: fix coverity unchecked return value issue [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=82d71fb81ea15c6152b23c44949b4d50c4eef6d9;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ir: fix coverity unchecked return value issue [1/1] PD#SWPL-13969 Problem: In sysfs.c, return value of class_register is not checked. Solution: check return value of class_register Verify: local coverity check Change-Id: If8deb3e388e784650e4812257143c3ac919c2d9a Signed-off-by: Qianggui Song --- diff --git a/drivers/amlogic/input/remote/sysfs.c b/drivers/amlogic/input/remote/sysfs.c index a6adb4f190c8..03e8b887b4a2 100644 --- a/drivers/amlogic/input/remote/sysfs.c +++ b/drivers/amlogic/input/remote/sysfs.c @@ -523,8 +523,11 @@ static struct class remote_class = { int ir_sys_device_attribute_init(struct remote_chip *chip) { struct device *dev; + int err; - class_register(&remote_class); + err = class_register(&remote_class); + if (unlikely(err)) + return err; dev = device_create(&remote_class, NULL, chip->chr_devno, chip, chip->dev_name);