mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
media: usb: s2255: Refactor s2255_get_fx2fw
Resize the buffer to the actual size needed and initialize it. With this we can convince gcc-11 that the variable is not used uninitialized. drivers/media/usb/s2255/s2255drv.c:1914:25: warning: 'transBuffer' may be used uninitialized [-Wmaybe-uninitialized] Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
8796f3357f
commit
c5b9b85a60
1 changed files with 4 additions and 3 deletions
|
@ -1906,9 +1906,10 @@ static int s2255_get_fx2fw(struct s2255_dev *dev)
|
|||
{
|
||||
int fw;
|
||||
int ret;
|
||||
unsigned char transBuffer[64];
|
||||
ret = s2255_vendor_req(dev, S2255_VR_FW, 0, 0, transBuffer, 2,
|
||||
S2255_VR_IN);
|
||||
u8 transBuffer[2] = {};
|
||||
|
||||
ret = s2255_vendor_req(dev, S2255_VR_FW, 0, 0, transBuffer,
|
||||
sizeof(transBuffer), S2255_VR_IN);
|
||||
if (ret < 0)
|
||||
dprintk(dev, 2, "get fw error: %x\n", ret);
|
||||
fw = transBuffer[0] + (transBuffer[1] << 8);
|
||||
|
|
Loading…
Add table
Reference in a new issue