drivers/media/usb/gspca/sq905c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Add error handling for sq905c_command() failure in sq905c_dostream().
Log debug message with gspca_dbg() to prevent silent failure.
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/media/usb/gspca/sq905c.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/gspca/sq905c.c b/drivers/media/usb/gspca/sq905c.c
index 6ca947aef298..7bb6b24c3ed1 100644
--- a/drivers/media/usb/gspca/sq905c.c
+++ b/drivers/media/usb/gspca/sq905c.c
@@ -183,7 +183,9 @@ static void sq905c_dostream(struct work_struct *work)
quit_stream:
if (gspca_dev->present) {
mutex_lock(&gspca_dev->usb_lock);
- sq905c_command(gspca_dev, SQ905C_CLEAR, 0);
+ ret = sq905c_command(gspca_dev, SQ905C_CLEAR, 0);
+ if (ret)
+ gspca_dbg(gspca_dev, D_STREAM, "Clear command failed\n");
mutex_unlock(&gspca_dev->usb_lock);
}
kfree(buffer);
--
2.42.0.windows.2
Hi Wentao Liang,
On 03/03/2025 16:23, Wentao Liang wrote:
> Add error handling for sq905c_command() failure in sq905c_dostream().
> Log debug message with gspca_dbg() to prevent silent failure.
>
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/media/usb/gspca/sq905c.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/gspca/sq905c.c b/drivers/media/usb/gspca/sq905c.c
> index 6ca947aef298..7bb6b24c3ed1 100644
> --- a/drivers/media/usb/gspca/sq905c.c
> +++ b/drivers/media/usb/gspca/sq905c.c
> @@ -183,7 +183,9 @@ static void sq905c_dostream(struct work_struct *work)
> quit_stream:
> if (gspca_dev->present) {
> mutex_lock(&gspca_dev->usb_lock);
> - sq905c_command(gspca_dev, SQ905C_CLEAR, 0);
> + ret = sq905c_command(gspca_dev, SQ905C_CLEAR, 0);
> + if (ret)
> + gspca_dbg(gspca_dev, D_STREAM, "Clear command failed\n");
Thank you for this patch, but I'm not taking it, it just adds a debug message
for no good reason that I can see. It's a really old driver as well.
If you really want it, then post the patch again and explain why you want this in.
Regards,
Hans
> mutex_unlock(&gspca_dev->usb_lock);
> }
> kfree(buffer);
© 2016 - 2026 Red Hat, Inc.