Andrzej Pietrasiewicz
f0f42204d0
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>
2014-02-20 09:17:23 -06:00
..
2013-12-20 09:51:24 -06:00
2014-01-08 15:01:39 -08:00
2013-03-18 11:16:56 +02:00
2014-01-08 15:01:39 -08:00
2013-08-02 15:17:03 +03:00
2014-01-23 18:36:55 -08:00
2013-05-24 07:14:45 +08:00
2012-09-10 16:43:24 +03:00
2014-02-18 10:34:54 -06:00
2013-09-17 10:38:52 -05:00
2013-12-19 09:27:43 -06:00
2012-10-31 15:09:44 +02:00
2013-12-19 09:27:42 -06:00
2013-10-01 09:50:22 -05:00
2013-01-21 20:52:43 +02:00
2013-12-17 13:17:41 -06:00
2014-01-08 15:01:39 -08:00
2013-07-25 20:35:23 +03:00
2013-08-30 11:10:36 -07:00
2013-12-12 13:43:36 -06:00
2013-09-17 11:06:50 -05:00
2014-02-20 09:17:23 -06:00
2013-11-26 13:41:32 -06:00
2013-12-17 13:17:42 -06:00
2013-12-17 13:17:43 -06:00
2013-10-10 10:24:53 -05:00
2013-11-26 13:41:32 -06:00
2013-12-17 13:17:43 -06:00
2013-12-17 13:17:43 -06:00
2013-12-17 13:17:44 -06:00
2013-12-12 13:43:38 -06:00
2013-12-17 13:17:44 -06:00
2013-12-17 13:17:44 -06:00
2013-12-12 13:43:37 -06:00
2013-08-09 16:34:19 +03:00
2013-06-10 17:10:23 +03:00
2013-07-13 12:09:57 -07:00
2013-03-18 11:18:18 +02:00
2013-12-17 13:17:41 -06:00
2013-06-10 17:58:11 +03:00
2013-07-30 11:18:46 +03:00
2014-01-08 15:01:39 -08:00
2012-06-12 13:32:29 +03:00
2013-12-17 13:17:41 -06:00
2013-01-18 14:08:21 +02:00
2013-01-21 20:52:46 +02:00
2013-12-17 13:17:41 -06:00
2013-04-02 16:57:24 +03:00
2013-12-12 13:43:39 -06:00
2013-11-26 13:47:41 -06:00
2012-09-10 16:43:24 +03:00
2013-01-10 12:38:52 +02:00
2014-01-08 15:01:39 -08:00
2013-03-18 11:16:45 +02:00
2014-01-08 15:01:39 -08:00
2013-12-23 19:26:13 -06:00
2013-07-30 11:18:46 +03:00
2013-09-13 10:55:58 -07:00
2013-12-23 19:26:13 -06:00
2013-12-17 13:17:41 -06:00
2013-12-17 13:17:41 -06:00
2013-01-24 21:11:29 +02:00
2013-12-23 19:26:13 -06:00
2013-10-10 10:24:10 -05:00
2013-12-20 09:51:24 -06:00
2014-01-08 15:01:39 -08:00
2012-06-22 13:08:21 +03:00
2014-01-08 15:01:39 -08:00
2013-04-02 11:42:45 +03:00
2013-06-10 17:12:52 +03:00
2013-12-17 13:17:41 -06:00
2013-12-17 13:17:41 -06:00
2013-12-17 13:17:41 -06:00
2014-01-08 15:01:39 -08:00
2013-12-17 13:17:41 -06:00
2014-02-20 09:17:22 -06:00
2014-01-08 15:01:39 -08:00
2013-01-24 21:11:31 +02:00
2013-12-17 13:17:41 -06:00
2013-01-24 21:11:31 +02:00
2013-12-17 13:17:41 -06:00
2012-07-30 17:25:12 -07:00
2014-01-08 15:01:39 -08:00
2013-06-10 17:58:09 +03:00
2014-02-18 10:34:04 -06:00
2013-01-24 21:11:32 +02:00
2014-01-07 16:30:10 -08:00
2013-12-23 14:31:49 -06:00
2013-12-17 13:17:41 -06:00
2013-04-03 14:43:36 +03:00
2013-10-15 06:52:08 -05:00
2013-11-25 10:56:33 -06:00
2013-11-25 11:19:41 -06:00
2012-09-10 16:13:00 +03:00
2013-06-10 17:27:54 +03:00
2013-06-10 17:58:00 +03:00
2013-06-10 17:15:43 +03:00
2013-11-26 10:58:17 -06:00
2013-12-12 13:43:37 -06:00
2013-11-26 13:41:32 -06:00
2013-11-26 13:41:32 -06:00
2013-12-12 13:43:40 -06:00
2013-06-10 17:58:08 +03:00
2013-06-10 17:15:02 +03:00
2013-06-10 17:31:55 +03:00
2013-12-12 13:43:38 -06:00
2013-03-14 12:47:53 +02:00
2013-04-03 14:43:20 +03:00
2013-08-09 16:34:13 +03:00
2013-10-04 09:44:43 -05:00
2014-01-08 15:01:39 -08:00
2013-08-09 17:40:54 +03:00
2013-04-02 11:42:48 +03:00
2013-04-02 11:42:49 +03:00
2013-04-02 11:42:48 +03:00
2013-06-21 11:04:47 -03:00
2013-01-10 12:38:52 +02:00
2013-12-19 09:18:53 -06:00