Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5371967imm; Sun, 22 Jul 2018 20:55:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdXW1hiKJVtuY2qkM70Mv/xhYLYj5M9tvbPC42f3UrLSHHot422EVVS2kdkQ7GhgJRVNtE3 X-Received: by 2002:a62:5984:: with SMTP id k4-v6mr11530541pfj.116.1532318116058; Sun, 22 Jul 2018 20:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532318116; cv=none; d=google.com; s=arc-20160816; b=sLBIsjJrEs3oTyRBM7bJoDGeYbAxCMMy42973VSNI8Yd3kmOyjYgu4e7hv+e4MPwSG tBMQWBgDAJdrtwvrtBH9F+CdivA3iCUhVYBt+zpJh8Ag66z1xhoor++cgdddaNLHUYNY VvxigWz/slf4zE8TC7uTAdzh61FrNjSLbSPmQ6TwlNrSFuDiOKakJm04skkaak3kd0ek Om8VC8V5Bymia5IqsD6MmlX6+P2/bl4j/C/21+GElnbXXYMVuWWhhk2DwEJ22oGZpERS A7r9kyY8jqNgUQzhr0EQIDb8ipFJ0czXED9YUHsyVoD0hGM2g6lzyl1iAGfU5vaXcJk0 5AIw== 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=D9EdVxyjb4U6oRwc+8S2kmFfMTkbe6FA783T3foX4lA=; b=ep0WJ4U6ni8szqJu/d2A39T54H1fv1bSDD+vqeiTmnbWoig5q9DtvLFrsU+tm/GfeI Mf10HwRwRsqPMCR8tMgu8Ie411MgURT6uhDjrakgngi2J5BO+QjSSeSMYr6Yhff9pz9w Kv8Z2ayWVXXLh+iUEKjX3U/VOS4WOEW2kPvCK0LjF89vaAcH9EllCM1A2d0mnANLeIXw s+6pnPBthmphRiMDtwte42vG64ucNIEEWXPRmVHAwxT/UM9S7cRJeDzjhOjaynliCqhJ JKOo+n97GHzyd+sxmTQViGTvQAjBitVdPLZt4jWv7plvPEiP9f01ZHI+OAVvqOWjwJTD Wo9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tLgWcDEY; 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 q23-v6si7986576pgq.483.2018.07.22.20.55.01; Sun, 22 Jul 2018 20:55:16 -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=tLgWcDEY; 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 S1728275AbeGWEwi (ORCPT + 99 others); Mon, 23 Jul 2018 00:52:38 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40106 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbeGWEwi (ORCPT ); Mon, 23 Jul 2018 00:52:38 -0400 Received: by mail-pl0-f66.google.com with SMTP id s17-v6so7647270plp.7; Sun, 22 Jul 2018 20:53:30 -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=D9EdVxyjb4U6oRwc+8S2kmFfMTkbe6FA783T3foX4lA=; b=tLgWcDEYPhlQSfIBDVO7U9J8UI/KRLPWpTpRZDlLffOPZYvCmDh8Eps/fSlEV3M8K5 tGfyzara59x8F2PFgPkgkO49LdpoBmdMvISR7uYsX1T0JPB6mGXDYtgNXniokVKKJxLU iX64Wpu2sbglGkqyBjoojogxOh6daVSn6rEJaUpcmhoIcniwAwNRJqhRwOf6/y+hAa+v Wc5sAlUD1wTwdhADKmGgtK8GrnlCZrlJKEEC8zGUCsVmb+sbTM56A4KGkKbO1fPaO+Mz FuevfbPcRMboHF4+SQiZZ/X7yD+Dl2/7+wklG3eBF7+1QBjseHSAEL+i/ANlqkwBnjwj WTnA== 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=D9EdVxyjb4U6oRwc+8S2kmFfMTkbe6FA783T3foX4lA=; b=ekjSRj9gnkpRwrU/kDx53gt2zaJ1vP67RKtw8TQrMuOQ8hDqUtGnJjus278hUykCSI Vm4Le6wJg6uI+8BSrOYtAaBt9Oj5hOokY0oAYDtBMasSFOVyXRhYvx0ioda7xiQizDf5 iy9ngd2/9iKN7c6SVEL7R5USQyc9Je+HXo4ALp7OwvAl9ir+oW8zScAjYEE+CgbaPETw pjgDgvMisvlEK+/KYAjUQUVuSZLIpIM2VJARjT+yHSpUcMrEsrBqwgAF29eEQbVEzJm8 sI1Njc9ODIHpJaush9P6JfwP1cKIDxwA0d7SDFFLMPJslzfKzmH6HyT79cCl6v3RIWdt jLyA== X-Gm-Message-State: AOUpUlGESHuXNev4aSv7ePyIfERkXwf3glH3aCDLilXkRl0YDV2dtJeP eb9L5ibBjcZvCxHJ9StVrC0= X-Received: by 2002:a17:902:b785:: with SMTP id e5-v6mr11277064pls.339.1532318010188; Sun, 22 Jul 2018 20:53:30 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:c122:f95a:1d53:1f82]) by smtp.gmail.com with ESMTPSA id l4-v6sm10161111pgn.46.2018.07.22.20.53.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Jul 2018 20:53:29 -0700 (PDT) From: Jia-Ju Bai To: marcel@holtmann.org, johan.hedberg@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] bluetooth: hci_intel: Replace GFP_ATOMIC with GFP_KERNEL in inject_cmd_complete() Date: Mon, 23 Jul 2018 11:53:21 +0800 Message-Id: <20180723035321.8270-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 inject_cmd_complete() is only called by intel_dequeue(), which is never called in atomic context. inject_cmd_complete() calls bt_skb_alloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai --- drivers/bluetooth/hci_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index 7c166e3b308b..46ace321bf60 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -458,7 +458,7 @@ static int inject_cmd_complete(struct hci_dev *hdev, __u16 opcode) struct hci_event_hdr *hdr; struct hci_ev_cmd_complete *evt; - skb = bt_skb_alloc(sizeof(*hdr) + sizeof(*evt) + 1, GFP_ATOMIC); + skb = bt_skb_alloc(sizeof(*hdr) + sizeof(*evt) + 1, GFP_KERNEL); if (!skb) return -ENOMEM; -- 2.17.0