media: dvb-frontends/rtl2832.c: fix missing error code
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 20 Jan 2021 09:03:21 +0000 (10:03 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 27 Jan 2021 07:37:18 +0000 (08:37 +0100)
Fixes this smatch warning:

drivers/media/dvb-frontends/rtl2832.c:702 rtl2832_read_status() warn: missing error code 'ret'

'ret' is indeed not set, so set it to -EINVAL so a proper error
code is returned.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/dvb-frontends/rtl2832.c

index 01dcc7f..dcbeb9f 100644 (file)
@@ -698,6 +698,7 @@ static int rtl2832_read_status(struct dvb_frontend *fe, enum fe_status *status)
                        goto err;
 
                constellation = (u8tmp >> 2) & 0x03; /* [3:2] */
+               ret = -EINVAL;
                if (constellation > CONSTELLATION_NUM - 1)
                        goto err;