media: firewire: firedtv-avc.c: replace BUG with proper, error return
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 4 Aug 2023 10:59:41 +0000 (12:59 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Thu, 10 Aug 2023 05:58:37 +0000 (07:58 +0200)
This resolves this smatch error:

drivers/media/firewire/firedtv-avc.c:602 avc_tuner_dsd() error: uninitialized symbol 'pos'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/firewire/firedtv-avc.c

index 71991f8..a36c284 100644 (file)
@@ -597,7 +597,8 @@ int avc_tuner_dsd(struct firedtv *fdtv,
        case FIREDTV_DVB_C: pos = avc_tuner_dsd_dvb_c(fdtv, p); break;
        case FIREDTV_DVB_T: pos = avc_tuner_dsd_dvb_t(fdtv, p); break;
        default:
-               BUG();
+               ret = -EIO;
+               goto unlock;
        }
        pad_operands(c, pos);
 
@@ -612,6 +613,7 @@ int avc_tuner_dsd(struct firedtv *fdtv,
        if (status)
                *status = r->operand[2];
 #endif
+unlock:
        mutex_unlock(&fdtv->avc_mutex);
 
        if (ret == 0)