From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com ([192.55.52.93]:52436 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbdAWLdy (ORCPT ); Mon, 23 Jan 2017 06:33:54 -0500 From: Felipe Balbi To: Krzysztof Opasiak Cc: gregkh@linuxfoundation.org, k.opasiak@samsung.com, eu@felipetonello.com, zonque@gmail.com, david@lechnology.com, linux-usb@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 4/4] usb: gadget: f_hid: fix: Move IN request allocation to set_alt() In-Reply-To: <1484848530-13040-4-git-send-email-k.opasiak@samsung.com> References: <1484848530-13040-1-git-send-email-k.opasiak@samsung.com> <1484848530-13040-4-git-send-email-k.opasiak@samsung.com> Date: Mon, 23 Jan 2017 13:33:43 +0200 Message-ID: <874m0q80yw.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: stable-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Krzysztof Opasiak writes: > Since commit ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") > we cannot allocate any requests in bind() as we check if we should > align request buffer based on endpoint descriptor which is assigned > in set_alt(). > > Allocating request in bind() function causes a NULL pointer > dereference. > > This commit moves allocation of IN request from bind() to set_alt() > to prevent this issue. > > Fixes: ba1582f22231 ("usb: gadget: f_hid: use alloc_ep_req()") > Cc: stable@vger.kernel.org > Signed-off-by: Krzysztof Opasiak please rebase on testing/next: checking file drivers/usb/gadget/function/f_hid.c Hunk #1 succeeded at 338 (offset 54 lines). Hunk #2 succeeded at 348 (offset 54 lines). Hunk #3 succeeded at 363 (offset 54 lines). Hunk #4 succeeded at 376 (offset 54 lines). Hunk #5 succeeded at 611 (offset 54 lines). Hunk #6 succeeded at 648 (offset 54 lines). Hunk #7 FAILED at 611. Hunk #8 succeeded at 686 (offset 54 lines). Hunk #9 succeeded at 765 (offset 54 lines). Hunk #10 succeeded at 802 (offset 65 lines). Hunk #11 succeeded at 1068 (offset 65 lines). 1 out of 11 hunks FAILED previous 3 patches applied fine, though. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAliF6hcACgkQzL64meEa mQbJOQ//af14wl1uZQ01FMpl/6SWglvG5A4Qwv56EZr/V8mlffDqLl2J6eLkq2NH 5dCqextbXgmirrUyHPaPUW86tlcAa5CP94OQoMdDooZznkGAaf92KO9uU0cPtdIo AoaSJdezam2VqOfsc7lqpDvohZebZsJhptzt/o6DgbO0zpcm5dG5dfDks1Kj1olf 8C4bp7lbSLlL00j0hDJjUcmto/eOQ9wXPmRqyKrecMt5yQFwL6cNXGHBdMGto9v8 5vITB0GIOxZhas0KFInJ8l9mho0OHj0ijxMvN3BViWkn6sURafzaMUucngJ0891k Hg6emQj2naI3gGIbUabc3zMVqcsccCUh+23hW94IlmnaWudxtDXJHz4e1mv8Izdk Nf0QOn+tdETgmqQ5O7fkwOCetWtOlzUIUbUdPdkiH81Ak7lync2jWlBCZ2UzEl1x KNCHUR2E+ALTfa7xkegOW4Nj7JSeYfbOhn3omxraOIbAbr3WQ4NGTDcFQ+LNAHWp J2pa+MtNDuEZHA3HkkC8Rh5fM20WtnOLgzQK7V4/TS3xNAlKQieapSIdbr2OtR9e NRQhcLj6ZqFJ16BW6A8fIWdDDBZU2gDgGqIwDLtPia8VW9a83arKCczMbY0e3v10 6C0SxbRrzbAhR8dnlbapen8QuuYZx09fYhlEAZS2NgFXw62sNo8= =iEK0 -----END PGP SIGNATURE----- --=-=-=--