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 <qianggui.song@amlogic.com>
This commit is contained in:
Qianggui Song
2019-09-11 17:22:50 +08:00
committed by Tao Zeng
parent df04c0675a
commit 82d71fb81e

View File

@@ -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);