diff options
author | Kangjie Lu <kjlu@umn.edu> | 2018-12-25 07:31:21 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-01-16 17:24:35 +0100 |
commit | 5ceaf5452c1b2a452dadaf377f9f07af7bda9cc3 (patch) | |
tree | 19682d3ad2cd3d6897ce03426cafb8710b40bf59 /drivers/media/usb | |
parent | media: sunxi: cedrus: Fix missing error message context (diff) | |
download | linux-5ceaf5452c1b2a452dadaf377f9f07af7bda9cc3.tar.xz linux-5ceaf5452c1b2a452dadaf377f9f07af7bda9cc3.zip |
media: usb: gspca: add a missed return-value check for do_command
do_command() may fail. The fix adds the missed return value of
do_command(). If it fails, returns its error code.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/gspca/cpia1.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/usb/gspca/cpia1.c b/drivers/media/usb/gspca/cpia1.c index 2b09af8865f4..23fbda56fc91 100644 --- a/drivers/media/usb/gspca/cpia1.c +++ b/drivers/media/usb/gspca/cpia1.c @@ -547,10 +547,14 @@ static int do_command(struct gspca_dev *gspca_dev, u16 command, } if (sd->params.qx3.button) { /* button pressed - unlock the latch */ - do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, + ret = do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, 3, 0xdf, 0xdf, 0); - do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, + if (ret) + return ret; + ret = do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, 3, 0xff, 0xff, 0); + if (ret) + return ret; } /* test whether microscope is cradled */ |