Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp287713imm; Thu, 26 Jul 2018 19:14:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc92nDGgn4wc5o5UmJtbKLyqLIARRGJjEp64P+Yy/1jDhgyYGTZiSA/u++kChh+Y4F2AaAw X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr4108166pgh.28.1532657646967; Thu, 26 Jul 2018 19:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532657646; cv=none; d=google.com; s=arc-20160816; b=0PQpGo9FWG9p6Yr2/E+TzQgKZQ1dHabC1e/K70s1ilRTue3bvOe0C3vJETK3+pcbs1 xIVBndDAmkrAkCcN668IL202WQCQZOz5Z8IKyjl6eTsrjMZYycUxVORP3V4yNA1u0rqi HjIY6Ku2LI+KKTGME4Z/HpyZUH2hig6RpTwTRqFLa11KZgNC59u8qD/TEaBFa+T6Hd4K jtN4LosVTtYq2xsnCrxvhy49LORQKpn04cSCBZwhuzhCa/PXBCmbl3NophYpqKxNg0s1 V6J6TFxptcRosLocCmf+rxSMw+nSF8SaW84tI0vnuXS7lRUfmiys99WjtbRmZLkfKyvC kuHg== 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=nVAkD3uKYDtdsLDY4zEptBxny+D9QKC8Gw+NBOVmUEs=; b=Hg5qYRUwyXNewIDSE0ESmqlfufDYWxuWNO1Wryd0WMaEfRLjANVJHV1qUzK5G44hCS eXlSUqgLUkqgsTYW1KyHJ9ljCO1F0DQGrQZWqTWuUimMGBQYybYJp0SqWHt7GoxzHJnh 9Oc8HtMC0s/2YPICAcfmNH+ZuhILZG2uekhyT+yHrHXj1Q2MEfmGax5xODFnHfWXzVND rj6IeVJCP84moE4HmlL7eKBEQ1VSOMAj1ukm0QeALdg9Q2Na7tDcGdLdY3wOH4a7rVGJ kAcjQFuAvC4GQ52yErJ4SzJl9zrTmSeFwVEmboxfobvCKF9qHdOjozSAHQJuBedS5MMv Grig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FUPbWPAL; 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 q28-v6si2395867pgm.362.2018.07.26.19.13.51; Thu, 26 Jul 2018 19:14:06 -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=FUPbWPAL; 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 S1732113AbeG0Dci (ORCPT + 99 others); Thu, 26 Jul 2018 23:32:38 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43333 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732043AbeG0Dci (ORCPT ); Thu, 26 Jul 2018 23:32:38 -0400 Received: by mail-pg1-f196.google.com with SMTP id v13-v6so2274473pgr.10; Thu, 26 Jul 2018 19:13:05 -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=nVAkD3uKYDtdsLDY4zEptBxny+D9QKC8Gw+NBOVmUEs=; b=FUPbWPALh1VywiThhmtNnzWlNCCzMTb95oh0gzHNd38vYnQXSCrqTW1VegcM/sNVOQ Volob6mgUcjOhdMkjAEKpKh+zCdT6L/gOSiBK200KtKJlSm6fbB/nqw/qZh5+20JIOSG sTT+Bytn6mjx8yp67Wez+gQ3RZoX/N9kScHGJ6KuEribPpEPWFQYcEX868SsVxOQx3sX 7eAmLK8N1B13eRsovsGjEQaBVAdTF95rw5F9oPuCIg2ieOrJe4dIpGocVUQ57YKf0LRR d3M0zmJ5opJcf8+kyRYqalSOEXzTouXEBRWnjqfZlYTcILzqxcrjli6KELc7QPlK3VeV 8ykw== 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=nVAkD3uKYDtdsLDY4zEptBxny+D9QKC8Gw+NBOVmUEs=; b=DyWxgbmFoHsNNOGgV6Z3IKuTdFHb0kE07cWkzjW/3XRiAGN7GErsO6LQ51pOih+TFS dZZ/vZblz/IglezFPOV02+rp3g162nWpxQjFXsQCa5gynBQjJ9Ia/0IhzZ4m9+9rMORx L8MX+9dDB7jl2D3dgTS3Fn0iZeY8kVN78m7qUTUXVpDTUqquuIGiQPXNPS/VEWLU4XM+ vRPo2CtSDQVXRj6CSj0GFKvFTLYo6p2DM0ub41jKjPnR+7D0HE5g1CziWGzcj9tEkL7l h0706C9zdiApMa3iOOj33Oc9IATaM+sLm9niOQ4Jdoqop3j9D22MelH2cVMKEwhuJut5 R/RA== X-Gm-Message-State: AOUpUlEObw9e8zevnrQ4BCCkFhRXTj2LhyetsR/nckliSR+Tjq65v4KR 7Tqu07f7bIj2EQNxVZ8Sq2DIPTJw X-Received: by 2002:a65:5c83:: with SMTP id a3-v6mr4205137pgt.164.1532657585675; Thu, 26 Jul 2018 19:13:05 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id f5-v6sm3565406pga.58.2018.07.26.19.13.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:13:05 -0700 (PDT) From: Jia-Ju Bai To: dmitry.torokhov@gmail.com, arvind.yadav.cs@gmail.com, gregkh@linuxfoundation.org, pombredanne@nexb.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] input: misc: keyspan_remote: Replace GFP_ATOMIC with GFP_KERNEL in keyspan_probe() Date: Fri, 27 Jul 2018 10:12:58 +0800 Message-Id: <20180727021258.29675-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org keyspan_probe() is never called in atomic context. It calls usb_alloc_coherent() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replace with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/input/misc/keyspan_remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index 67482b248b2d..a8937ceac66a 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c @@ -466,7 +466,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic remote->in_endpoint = endpoint; remote->toggle = -1; /* Set to -1 so we will always not match the toggle from the first remote message. */ - remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_ATOMIC, &remote->in_dma); + remote->in_buffer = usb_alloc_coherent(udev, RECV_SIZE, GFP_KERNEL, &remote->in_dma); if (!remote->in_buffer) { error = -ENOMEM; goto fail1; -- 2.17.0