From patchwork Fri Jul 27 08:43:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10546741 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0CD87112B for ; Fri, 27 Jul 2018 08:43:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1F552883F for ; Fri, 27 Jul 2018 08:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E63842B6D5; Fri, 27 Jul 2018 08:43:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CA072883F for ; Fri, 27 Jul 2018 08:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730513AbeG0KEQ (ORCPT ); Fri, 27 Jul 2018 06:04:16 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43918 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729489AbeG0KEQ (ORCPT ); Fri, 27 Jul 2018 06:04:16 -0400 Received: by mail-pf1-f196.google.com with SMTP id j26-v6so1504622pfi.10; Fri, 27 Jul 2018 01:43:25 -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=ewDV6dedJ33kYqT8u9IK92Ungk2gWImAxEcOARmyGFI=; b=VWyj/zd6HN8aEdCC6RB8s/zVRlO/WU1JlxxLfasOVNNaz4JJmsv+nSLL8U0t7gRPJz e2IOIhh2o6RXMngSee013eTdiTerJ+4jBZ+vSDL3dkc5OMW8Z+mtYk9XjYrldboGsqz6 zx+pcD2l0PL0U82eycu9bKEuzj6quB3stSw/fxfNCbkFUFyuBQOjc1yBcA8IQLTMxj1F zbCIpOnRz1q3XiQTEDVl56Hyj923DQ6UAYdVPksHKs13EM9uazbtfWR52P7mIcrqvj0h VKA5+OXpTUg073tJtDvP76Ixu21MzCkkfBNqhE4VF0JAwZ/bRqTMYuj/OsVPPy0ieZhl AAdw== 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=ewDV6dedJ33kYqT8u9IK92Ungk2gWImAxEcOARmyGFI=; b=V3VE57Uxu0vLH6OC8FaWNQl6FxUtP6oXL9bJZw7QOOsyvgOYzfWQ46A7lh/vtqpzmG p7FQGbRXYh7h3y0EO9cx6Mj7kY+vqbfpyPGr5b4+dh6KbDsXsjieOo19hk6ETxn2fv9p z6JX/GjX1iM+IUgmLDZemX+bBWkb+ZA0jvLsClNqNbYF7Bzf86P46mjMbMYtqbNAYKof iB4xtFivUNBDeRKIIiIkgYa3z6VhyQSbYCn3SK9hwywZ3l/ykh76etxeTVNyEBUsaC3a VkMeINtNIOE43tlIoKC1oDTFoXOOgqOLTEFelNZ9JUPotTssDFXDE71t8ZtzV+KtXPlq oYdw== X-Gm-Message-State: AOUpUlEHRiodxllW8VtseihjlXDTS48git9zaF/TvnxI6cdS0JqKR+r7 867amAnGGkkD4REpntQRzhk= X-Google-Smtp-Source: AAOMgpfezxuiDOL4EbCqceLzI7p7ILvLQa858GyqTovzlZBuixnq85nRq08Cq1WF4dFIA0gfArkTfg== X-Received: by 2002:a62:df82:: with SMTP id d2-v6mr5692678pfl.189.1532681005047; Fri, 27 Jul 2018 01:43:25 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:8ca7:1cde:b1e6:2647]) by smtp.gmail.com with ESMTPSA id e126-v6sm8107269pfg.31.2018.07.27.01.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Jul 2018 01:43:24 -0700 (PDT) From: Jia-Ju Bai To: kvalo@qca.qualcomm.com Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: wireless: ath6kl: Replace GFP_ATOMIC with GFP_KERNEL in ath6kl_bmi_init() Date: Fri, 27 Jul 2018 16:43:18 +0800 Message-Id: <20180727084318.3345-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ath6kl_bmi_init() is never called in atomic context. It calls kzalloc() 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. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/ath/ath6kl/bmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c index 334dbd834b3a..bde5a10d470c 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.c +++ b/drivers/net/wireless/ath/ath6kl/bmi.c @@ -534,7 +534,7 @@ int ath6kl_bmi_init(struct ath6kl *ar) /* cmd + addr + len + data_size */ ar->bmi.max_cmd_size = ar->bmi.max_data_size + (sizeof(u32) * 3); - ar->bmi.cmd_buf = kzalloc(ar->bmi.max_cmd_size, GFP_ATOMIC); + ar->bmi.cmd_buf = kzalloc(ar->bmi.max_cmd_size, GFP_KERNEL); if (!ar->bmi.cmd_buf) return -ENOMEM;