]> git.baikalelectronics.ru Git - kernel.git/commit
staging: most: cdev: add missing check for cdev_add failure
authorColin Ian King <colin.king@canonical.com>
Sat, 2 Feb 2019 22:34:49 +0000 (22:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Feb 2019 11:36:14 +0000 (12:36 +0100)
commitf6881086ee5928ccb47193d08c6d9efb298f9ca5
tree882fe49aad59783f877aa0dea2fca6a9a0bf7b69
parentecdf2e48ad6e8f5ff821d2aa5012dfa7d5da9e60
staging: most: cdev: add missing check for cdev_add failure

Currently the call to cdev_add is missing a check for failure. Fix this by
checking for failure and exiting via a new error path that ensures the
allocated comp_channel struct is kfree'd.

Detected by CoverityScan, CID#1462359 ("Unchecked return value")

Fixes: 63ca36fee220 ("Staging: most: add MOST driver's aim-cdev module")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/cdev/cdev.c