]> git.baikalelectronics.ru Git - kernel.git/commit
media: uvcvideo: Cleanup uvc_ctrl_add_info() error handling
authorHans de Goede <hdegoede@redhat.com>
Tue, 28 Jul 2020 11:22:09 +0000 (13:22 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 10 Sep 2020 12:06:27 +0000 (14:06 +0200)
commit8c075b27a2ff3c439020482939538f7ecef467ae
tree399185816e9ceafe94066be952ff61191ce0addc
parentd77a7825e98320fea0f210ef0e44ed330c747d56
media: uvcvideo: Cleanup uvc_ctrl_add_info() error handling

There is only 1 error exit in uvc_ctrl_add_info(), so using goto style
error handling is not necessary. Also the kfree(ctrl->uvc_data) on error
is not necessary, because the only error exit is for the kzalloc() of
ctrl->uvc_data failing.

Remove all the error handling cruft and simply do "return -ENOMEM" on
kzalloc() failure.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c