Commit 5ceaf545 authored by Kangjie Lu's avatar Kangjie Lu Committed by Mauro Carvalho Chehab

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: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6f2c6afa
...@@ -547,10 +547,14 @@ static int do_command(struct gspca_dev *gspca_dev, u16 command, ...@@ -547,10 +547,14 @@ static int do_command(struct gspca_dev *gspca_dev, u16 command,
} }
if (sd->params.qx3.button) { if (sd->params.qx3.button) {
/* button pressed - unlock the latch */ /* button pressed - unlock the latch */
do_command(gspca_dev, CPIA_COMMAND_WriteMCPort, ret = do_command(gspca_dev, CPIA_COMMAND_WriteMCPort,
3, 0xdf, 0xdf, 0); 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); 3, 0xff, 0xff, 0);
if (ret)
return ret;
} }
/* test whether microscope is cradled */ /* test whether microscope is cradled */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment