media: pwc-ctl: pChoose can't be NULL
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 25 Mar 2019 20:20:47 +0000 (16:20 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 25 Mar 2019 22:02:27 +0000 (18:02 -0400)
commit4f777d011bdd9e78fcf02701e89c8be457504a6c
tree742a78d07fb8297d8bf88c6e61717080adab75d7
parent3d19cde7be76d4471426edc348bcf3b45c64f097
media: pwc-ctl: pChoose can't be NULL

The way the code works, compression will be a valid value (less or equal to 3)
on both set_video_mode_foo() calls at the beginning of the while() loop.

So, the value for pChoose can't be NULL.

Solves those smatch warnings:

drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:252 set_video_mode_Timon() warn: variable dereferenced before check 'pChoose' (see line 248)
drivers/media/usb/pwc/pwc-ctrl.c: drivers/media/usb/pwc/pwc-ctrl.c:302 set_video_mode_Kiara() warn: variable dereferenced before check 'pChoose' (see line 298)

and simplifies the code a little bit.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/pwc/pwc-ctrl.c