summaryrefslogtreecommitdiffstats
path: root/mm/process_vm_access.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-01-20 08:33:50 +0100
committerFelipe Balbi <balbi@ti.com>2014-02-20 09:17:23 -0600
commitf0f42204d0cc04a63ac61fdaa3b6a269ea0dc08b (patch)
tree5e564e3f582d872a91433cc62dc1fa3ff8007cbd /mm/process_vm_access.c
parent8679059e360543b7afecd228ada6566da9f304a4 (diff)
downloadop-kernel-dev-f0f42204d0cc04a63ac61fdaa3b6a269ea0dc08b.zip
op-kernel-dev-f0f42204d0cc04a63ac61fdaa3b6a269ea0dc08b.tar.gz
usb: gadget: fix NULL pointer dereference
Fix possible NULL pointer dereference introduced in commit 219580e (usb: f_fs: check quirk to pad epout buf size when not aligned to maxpacketsize) In cases we do wait with: wait_event_interruptible(epfile->wait, (ep = epfile->ep)); for endpoint to be enabled, functionfs_bind() has not been called yet and epfile->ffs->gadget is still NULL and the automatic variable 'gadget' has been initialized with NULL at the point of its definition. Later on it is used as a parameter to: usb_ep_align_maybe(gadget, ep->ep, len) which in turn dereferences it. This patch fixes it by moving the actual assignment to the local 'gadget' variable after the potential waiting has completed. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'mm/process_vm_access.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud