From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932206AbcHOIqp (ORCPT ); Mon, 15 Aug 2016 04:46:45 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35555 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbcHOIqn (ORCPT ); Mon, 15 Aug 2016 04:46:43 -0400 Date: Mon, 15 Aug 2016 10:46:39 +0200 From: Johan Hovold To: Alexey Khoroshilov Cc: Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH 2/2] USB: mos7840: fix non-atomic allocation in write path Message-ID: <20160815084639.GA2226@localhost> References: <1470953109-4280-1-git-send-email-khoroshilov@ispras.ru> <1470953109-4280-2-git-send-email-khoroshilov@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470953109-4280-2-git-send-email-khoroshilov@ispras.ru> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 12, 2016 at 01:05:09AM +0300, Alexey Khoroshilov wrote: > There is an allocation with GFP_KERNEL flag in mos7840_write(), > while it may be called from interrupt context. > > Follow-up for commit 191252837626 ("USB: kobil_sct: fix non-atomic allocation in write path") > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Alexey Khoroshilov > --- > drivers/usb/serial/mos7840.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c > index ed378fb232e7..1de2c01c078d 100644 > --- a/drivers/usb/serial/mos7840.c > +++ b/drivers/usb/serial/mos7840.c > @@ -1341,7 +1341,7 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port, > > if (urb->transfer_buffer == NULL) { > urb->transfer_buffer = > - kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); > + kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); Both patches now applied. I fixed up the odd indentation here while at it. Thanks, Johan