aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <[email protected]>2019-05-24 14:59:43 +0000
committerGreg Kroah-Hartman <[email protected]>2019-05-24 19:09:20 +0000
commita47686636d84eaec5c9c6e84bd5f96bed34d526d (patch)
treea91a54162e8114f2f406a739c89554e90181793a /fs/proc/array.c
parentxhci: Use %zu for printing size_t type (diff)
downloadkernel-a47686636d84eaec5c9c6e84bd5f96bed34d526d.tar.gz
kernel-a47686636d84eaec5c9c6e84bd5f96bed34d526d.zip
media: smsusb: better handle optional alignment
Most Siano devices require an alignment for the response. Changeset f3be52b0056a ("media: usb: siano: Fix general protection fault in smsusb") changed the logic with gets such aligment, but it now produces a sparce warning: drivers/media/usb/siano/smsusb.c: In function 'smsusb_init_device': drivers/media/usb/siano/smsusb.c:447:37: warning: 'in_maxp' may be used uninitialized in this function [-Wmaybe-uninitialized] 447 | dev->response_alignment = in_maxp - sizeof(struct sms_msg_hdr); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ The sparse message itself is bogus, but a broken (or fake) USB eeprom could produce a negative value for response_alignment. So, change the code in order to check if the result is not negative. Fixes: 31e0456de5be ("media: usb: siano: Fix general protection fault in smsusb") CC: <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions