Received: by 10.192.165.156 with SMTP id m28csp180746imm; Tue, 10 Apr 2018 19:18:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49m54jhusbaryOk7uvCPHLzwfh19O2v5QAtR5EGpNGz+HupqVxaMiafr6Qc7wLw8Duu0mJZ X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr2984857plg.23.1523413105398; Tue, 10 Apr 2018 19:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523413105; cv=none; d=google.com; s=arc-20160816; b=hILglJB5OilBLdk0Lm+Zw/DLvrNqo+vImK1cv412b93TyeZ5fcyFZROCJQlGC0yQAc oJ22Owsgz6l593ElJduwg8dpiSYWKXoe6v7ErZoqBQM6vwv43z9VMiBn1cOTwNqszjDC pJ2uifu5168uchPG/+N2+5YAASEVb3QIW6Fnh0LxqePylaUnpF06Is2YVQMS6PdPGOFV KWe6FYT+wuR/BPp9WWAG8LNB7vrhj6PPKQ820kTX/Opq2a8t1D3FT3ApcpyxNHe5GN+l Jvv1mbC/tdSG8Ufo9oBumblC3N1HyQVSbe4iR4cuAtNAdgOcQSfOcx1Fh1aE+HdjBOyS Bg5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=xo9jtb++bu9JDOaK0PG+EHdeWEoMilnV4XsJZ53nybU=; b=H1EqNJHA9A3mrMq+l0yDIS9QpLYFaZM4pJ+sDNFR4tw3QZ+6cxFr0/Fa3CVzBDZTZy 555x1fxgqUR0E+6ghWHtmANTg2REHgu/KBYVDFGl4gACn7BZxTaTlRJQYSUOUVzbLNu6 b4lQf8BT0jn7rCwMCPb/Ys0eN5enXKvdk+dY3CQFSZNvi+kwgzFmSdhV9ATdq06ldmAr PsTqe6aWI9oA8s02CypTLy9BEiULK4IP1Shzc7+MtT3MJDLIZyzniitTNxvibKzlS93n 95VQEA++AkYZDyJzahTD/lAoorgRWfXERA7wT6h8M/fRfuSDkMHJ7EZefvTeKMmoooSk jorA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vYbFQOnb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h23-v6si55024plr.576.2018.04.10.19.17.47; Tue, 10 Apr 2018 19:18:25 -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=pass header.i=@gmail.com header.s=20161025 header.b=vYbFQOnb; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752831AbeDKCOT (ORCPT + 99 others); Tue, 10 Apr 2018 22:14:19 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:36035 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbeDKCOR (ORCPT ); Tue, 10 Apr 2018 22:14:17 -0400 Received: by mail-pl0-f67.google.com with SMTP id 91-v6so234259pld.3; Tue, 10 Apr 2018 19:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xo9jtb++bu9JDOaK0PG+EHdeWEoMilnV4XsJZ53nybU=; b=vYbFQOnbOHasOcn6PVOO2343nW9zJ4DquYUHeryx9MeLQoTr2Rz04FZ/6V4JvyAaBP dujPDveU0PgbuaHdQjxlUPvi2EfdPg/sIwbfiaztpC3LLF6J/YI0YrkaiBGJfik2RMT9 VMkpE8mfDEsReoVgpW/qOvI8b7KGiw8+ztVDEQMvC3gTHlGI564RwqpQRJ7GaHj4koMU cFen4h13KRQEJ1OvkBd3XSxC8kOj+z2lFEbfuA/v6Krr0OFyX/J0c74UcH8irgVE7ccU QJjLuKEpGNEFoQXG4jySYYtQhU5e9Mtjplu0CGYZ2qHxx1ODHOWTkzZAw6vCXz1iyT+8 QYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xo9jtb++bu9JDOaK0PG+EHdeWEoMilnV4XsJZ53nybU=; b=MoQ6LTknssprWVnmVtmqtL69dBjY9si0k8hk58tnmFDCAocBwGNdxAdRcbmD64J6yC bEhKwpXwa6F/63MHj1UcFWBJOUi79GJs5fYPuNlnyl64WrOtHxNdtqK5zJiePYNZVo/e PpzeynaFvWyva68qcTGwrVmVOZGuTodkLJBuPPARcqMfSbc3PkRm2qEbm4qChvh1P2dM mHw9hggPx9X1yufcLb80Ad2UaqEEjX1TilMBwUdz/cqrAF/sIh3ECg+Am9Q0v+qoraBA iP7RrhnHRHEVyF0c8Xhuv4BRll2z38tlhA/EBI2TSe9ZI6Y0J2ILzEruuE8Ca/EPpPcX wU3Q== X-Gm-Message-State: ALQs6tBcXcW1+qdYBFp8aSdM5IZBkZjr8vNI+boOnzskAoxMc7zYB7WJ BlTUTV/hCFVlI93mozu+1nU= X-Received: by 2002:a17:902:b187:: with SMTP id s7-v6mr2951599plr.170.1523412856855; Tue, 10 Apr 2018 19:14:16 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:edc8:c1dd:b0a8:461d]) by smtp.gmail.com with ESMTPSA id b184sm109180pfg.110.2018.04.10.19.14.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 19:14:16 -0700 (PDT) From: Jia-Ju Bai To: stefan@osg.samsung.com, alex.aring@gmail.com Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: ieee802154: atusb: Replace GFP_ATOMIC with GFP_KERNEL in atusb_probe Date: Wed, 11 Apr 2018 10:14:10 +0800 Message-Id: <1523412850-2260-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org atusb_probe() is never called in atomic context. This function is only set as ".probe" in struct usb_driver. Despite never getting called from atomic context, atusb_probe() calls usb_alloc_urb() 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 --- drivers/net/ieee802154/atusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c index ef68851..ab6a505 100644 --- a/drivers/net/ieee802154/atusb.c +++ b/drivers/net/ieee802154/atusb.c @@ -789,7 +789,7 @@ static int atusb_probe(struct usb_interface *interface, atusb->tx_dr.bRequest = ATUSB_TX; atusb->tx_dr.wValue = cpu_to_le16(0); - atusb->tx_urb = usb_alloc_urb(0, GFP_ATOMIC); + atusb->tx_urb = usb_alloc_urb(0, GFP_KERNEL); if (!atusb->tx_urb) goto fail; -- 1.9.1