]> git.hungrycats.org Git - linux/commit
gadgetfs: fix uninitialized variable in error handling
authorArnd Bergmann <arnd@arndb.de>
Fri, 21 Apr 2017 13:06:12 +0000 (15:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Apr 2017 03:49:14 +0000 (05:49 +0200)
commit279b8b78a229ad47aadfba6d3b46ea9f72a58512
treeebcb151eea88c38c483cd3e581538a3c65b85295
parentf2d62e629983929083fc8871381451a9479a6fc0
gadgetfs: fix uninitialized variable in error handling

gcc warns about a bug in 3.18.y:

drivers/usb/gadget/legacy/inode.c:648:10: warning: 'value' may be used

This is caused by the backport of f01d35a15fa0416 from 4.0 to 3.18:
c81fc59be42c6e0 gadgetfs: use-after-free in ->aio_read()

The backported patch was buggy, but the mainline code was rewritten
in a larger patch directly following this one in a way that fixed the
bug.

For stable, we should need only a one-line change to make sure we
return an proper error code. It is very unlikely that anybody ever
ran into the out-of-memory case here in practice, but the compiler
is right in theory.

Fixes: c81fc59be42c ("gadgetfs: use-after-free in ->aio_read()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/legacy/inode.c