Received: by 10.213.65.68 with SMTP id h4csp4022491imn; Tue, 10 Apr 2018 08:07:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Urb7mhbshLtB9A+YQvnOvZie4iplrI0U19Q1NmlTD9jePrwEM138wSq2y8m4A0e5RWCJc X-Received: by 10.99.117.2 with SMTP id q2mr613443pgc.248.1523372821961; Tue, 10 Apr 2018 08:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523372821; cv=none; d=google.com; s=arc-20160816; b=NNgK5CgqmDY3Z5rPH4r9vY8YvuDcu6Bm4mYU8Em7hoINrTG+YjCq+Mc1DAsOtFT/xf dFpdGB1Rq8oowRrx58B1LnLpxDLctHoXcKHPBB8f+VxO1RYG8bk+DrLnYLu09ccCcf04 2z2XzmYs0GY+kLotcRVsBA1QnwO/i5j14G2p2+q+MZ4HONVuKGkmPLNye9hb1AI5Iz0+ hhEQVB/MvPZZRHFNZlAQnLJi9qsH5X78Pg7LlfM928cPOPd/jkba8s8F+80CNTBHmKSH XCi19Y9QzOhFEg/s2VOYtip+kApGAJEW/LYfUSGt3daKYoV0zQrFVk2W6KSgO9HNm3a4 focw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=VLS6VIzH0mNmXVDVwGBm5GsTwIu3BfBB+uGcC89NfnY=; b=URsl3VX0eKz2wYhzUwUwXR1RNt0ssP+TLGcT9crPf8Dwjc85BnMz63JDK1LX0FC7eB rgcob85LTeC0X9k4sXLuMsDUcVTRT6Je4Cqa7aZuawpvphUFgQsh62BwtumEaT+ZQ/5q TpKrT3GxMs9/r503Uuqgrj+TIR5fvKkkuIuEOWhGb4YEPR0sDg7D/nnoFBNWIogpnu3a V39mK+37ZannNgkn/sDXWd6A5GSd2Sw1s9UciRI+xeqMv3ylYXX/WpQil2mrFWVbv7Tq uKvDcTdbM7UKaB61wO4gFs6FXSTpDbJIzPWZAlDuLWRkC5OXOeePWuO/Fxs70AdtOr3y d3Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bllqBAr0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2-v6si559799plo.235.2018.04.10.08.06.23; Tue, 10 Apr 2018 08:07:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=bllqBAr0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754023AbeDJO7f (ORCPT + 99 others); Tue, 10 Apr 2018 10:59:35 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35754 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753694AbeDJO7e (ORCPT ); Tue, 10 Apr 2018 10:59:34 -0400 Received: by mail-lf0-f66.google.com with SMTP id b189-v6so2139023lfe.2; Tue, 10 Apr 2018 07:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=VLS6VIzH0mNmXVDVwGBm5GsTwIu3BfBB+uGcC89NfnY=; b=bllqBAr0aPIfGNBSZUBGlYIYrusOCUOWdkDBWW2j3l+MNEHEV3e6+x/prIgec75GQH g9YWvXOfWUnIBNdTXyWlVeVtROOuJLFdDw/wEo510qikeWpIm4Ne8De7G30aT92Hd3Pm qL+I5emxFrwIpq6xYIwAuzij522lWnmLhMSSecJWSq2U5/bQxC3L4Xn3F+T2W1AG7KWw z1zX3XngONQwIQjjMtRR1jL8m4OTdAvXHdeLqK3kg5qLwGvuUSPECy6dz7Okh2P8Jl18 vYkg1sP6AoVoL4FXpoDxO0L8gb6T44ZJJmMnWE7egz7104b/2tG9SxAHCH2EzR1XvvlA Bsag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VLS6VIzH0mNmXVDVwGBm5GsTwIu3BfBB+uGcC89NfnY=; b=CD6Dpv99cwN23uRNfweoJdU0d2HZffCwsS1ByR6iV0DcvFzd2P/lLK1YqAjUfVBBjY L6n2iZThUSS1rXW0RlWSmYjpssryAoHCb2OF3uY5hbHERm+LMhwmVwAz/kzXa/aZDLlc CQS0SjGC2dC23Km9ReWVF/+7H+ZQ73vHrUpK3XA69oba7u+iVIIx7KuusnNSr6MihBKm STtBEHxuPcTeCPkASyVvGTTo0lNUmtZx6K6rCTD/VuIAcFBvatuExxdVLq96yFTzGzud PRDU9hFl9vv7C35/14Y80ah0pb00wBQ/RX0DC6KXS6F6XDR1NJ9IUT/q756BRczllW73 EElg== X-Gm-Message-State: ALQs6tDoSmr5CljL8hAUmFlZnt2J6lfl4F4gvNG0szqXsYTiEff6qtwR 1IMxBOJj/f29+/SWnxI+wd4= X-Received: by 10.46.137.138 with SMTP id c10mr527048lji.0.1523372372425; Tue, 10 Apr 2018 07:59:32 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id d4-v6sm605995lfg.65.2018.04.10.07.59.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Apr 2018 07:59:31 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1f5uk4-00043L-4k; Tue, 10 Apr 2018 16:59:28 +0200 Date: Tue, 10 Apr 2018 16:59:28 +0200 From: Johan Hovold To: Jia-Ju Bai Cc: davem@davemloft.net, andreas@kemnade.info, johan@kernel.org, johannes.berg@intel.com, stephen@networkplumber.org, Linyu.Yuan@alcatel-sbell.com.cn, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: usb: hso: Replace GFP_ATOMIC with GFP_KERNEL in hso_create_device Message-ID: <20180410145928.GC10795@localhost> References: <1523370924-32425-1-git-send-email-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523370924-32425-1-git-send-email-baijiaju1990@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 10:35:24PM +0800, Jia-Ju Bai wrote: > hso_create_device() is never called in atomic context. > > The call chains ending up at hso_create_device() are: > [1] hso_create_device() <- hso_create_bulk_serial_device() <- hso_probe() > [2] hso_create_device() <- hso_create_mux_serial_device() <- hso_probe() > [3] hso_create_device() <- hso_create_net_device() <- hso_probe() > hso_probe() is set as ".probe" in struct usb_driver, > so it is not called in atomic context. > > Despite never getting called from atomic context, > hso_create_device() calls kzalloc() with GFP_ATOMIC, > which does not sleep for allocation. > GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, > which can sleep and improve the possibility of sucessful allocation. > > This is found by a static analysis tool named DCNS written by myself. > And I also manually check it. > > Signed-off-by: Jia-Ju Bai Thanks for the patch. This looks good to me. Reviewed-by: Johan Hovold Johan