Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5569568imm; Mon, 23 Jul 2018 01:59:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQJBBSh9OdQDzfg1CGOiAB5B6tkTRQkj2PUK/apWZ4g0KfrvYXC17HCgbGuKeVvOsSVmnk X-Received: by 2002:a63:9741:: with SMTP id d1-v6mr11062869pgo.403.1532336372127; Mon, 23 Jul 2018 01:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532336372; cv=none; d=google.com; s=arc-20160816; b=aulEvC/LsDhW9FRvVKS+u/vgchIUXCmA1YvrcaV9EflMstUktWxYPbtFdHr1xAthSj p2mkf11rqHRhPdKBjft0bvieksKl71dC+0I7zlqQ7IRE0IFbYsyqjDQX6Lk87BlB/Z8V tXnIG2Bg807jvvmxAUcbtIIi1ivJASnlBhmQiQ1f+8h5Dl72+pYaJeUPBNMUFHOE7No+ dtJdUZvy9VBIt0HbNC7zxwJp08DlK4ssXKUIVwOSK+vMyuFZRZWiDFd3cU2QGm3UQnXR E1fByXgZL6vOFnBHrorW1EP2Cozhw5X52fVxmz8cgz79oi06SQC7g9AWSadfWP1bNY9q U9/w== 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=Fka0vitggGyahAMbZNcUZqNpMbWxc2hePbIwCYKcFTU=; b=YP7Ci+rqHVOSt51M5se1iafL6B3kkklA1081CCVMHcZh3I4YxdT9RLaZJw1dadRoQX QdiwLR+GPj/NECgzxQN/VEBPcFPyAWq8A5dI9seKjtZxPuQdoxWaK3+L5jQ+hwb+fbx+ CUqbhyzwfYXhmP7OYAdc3tMDOEIIi9CrZVAOnU0EHdTimKAonev9oZ4sTGXY9OySyUl6 3fZ0XA0A4wHBKQH2VejZ0l3I+Lbca71gO0FTvMWlWE8mizFd63nXffXBLFiaoFk6J1yv AAn21MUbF9qwprM0CHkgwXXpYYyFk7b0OwdbrHAzTX1EWSKuNvQXso3xdynWZ6tmsL2e m8xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MPf7oT7I; 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 190-v6si8992623pfu.343.2018.07.23.01.59.17; Mon, 23 Jul 2018 01:59:32 -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=MPf7oT7I; 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 S2388179AbeGWJ6W (ORCPT + 99 others); Mon, 23 Jul 2018 05:58:22 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:42271 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387978AbeGWJ6V (ORCPT ); Mon, 23 Jul 2018 05:58:21 -0400 Received: by mail-io0-f194.google.com with SMTP id g11-v6so14904365ioq.9 for ; Mon, 23 Jul 2018 01:58:11 -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=Fka0vitggGyahAMbZNcUZqNpMbWxc2hePbIwCYKcFTU=; b=MPf7oT7IkuT7bbyv8la7r/jR+mF09WfH3yLJctGlihvYQ2/8nn+9Eq+IMOXCHzI8pl Ps35CMYmgnzqKk9CsN3b+WWpvF6yFl5nIPgwgBUdbchLq9nwCbVpBwzCwGme7yc2JCjh RBEAAfTSptCRRetbuy9jEkC1aDluyosZz5+Wan/StNZp7/KaTwyECKabiQWgquQv6ekU oiZuBZUeS8G0I/SDG1hbWUKu/PxLfv+wCRO3E3qMFAmudMs8cVZHVm/GdmK0+AA83Lmx Vyo9qEZoIFceR1WGxw3nUJrhlfG8jjTh5O6fyKyYM77kUmlirvOB1RorWmHb0fuXZcmO 9J0A== 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=Fka0vitggGyahAMbZNcUZqNpMbWxc2hePbIwCYKcFTU=; b=ufMkb1rYgp8DYf/N7pc0p4Z4ouQBNHI65l2/BfNuNRA5m9/5Q7Cd/aBZnvhmTblCln lS/7YIAn/MYF9VxPnZz7qxOZYsabw1vxnPEwzrpq4KYAPeCkufNJCvI+sklhd5wZeRSr sc8bBQZZ3JCRMX5ZMcFoZF8CAv5phtQKBqjAFv1xtdIAPWz39+22u3kwaDT1WjB2Pst/ +pPBhyW632zCPVM3fHnx44Sc2ZzS9pt8vp7ixYcO88dXqjWSAL3GusXRiuicnewFdqaS GH+DddzolwEpKCtMeUzFvW8N56vYA/VHt1XJkSmiMriX8DQeXzb8XyLWOcJjYhrb5LXy iTQA== X-Gm-Message-State: AOUpUlGj25tRcm01sWRV4f+YUd6ArtD9guMmZBootSW4FDGOuRLdg+qI DCKU1iyqkJDUK3GEkGbDsb4OdvvM X-Received: by 2002:a6b:e814:: with SMTP id f20-v6mr8891688ioh.269.1532336291572; Mon, 23 Jul 2018 01:58:11 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:e422:450a:e730:728b]) by smtp.gmail.com with ESMTPSA id b2-v6sm2610911iok.40.2018.07.23.01.58.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 01:58:11 -0700 (PDT) From: Jia-Ju Bai To: stefanr@s5r6.in-berlin.de Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] firewire: sbp2: Replace GFP_ATOMIC with GFP_KERNEL in sbp2_scsi_queuecommand() Date: Mon, 23 Jul 2018 16:58:01 +0800 Message-Id: <20180723085801.6711-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 sbp2_scsi_queuecommand() is only set to .queuecommand of "struct scsi_host_template", and this function pointer is never called in atomic context. sbp2_scsi_queuecommand() 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. I also manually check the kernel code before reporting it. Signed-off-by: Jia-Ju Bai --- drivers/firewire/sbp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 6bac03999fd4..a7cd9d87eb02 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -1463,7 +1463,7 @@ static int sbp2_scsi_queuecommand(struct Scsi_Host *shost, struct sbp2_command_orb *orb; int generation, retval = SCSI_MLQUEUE_HOST_BUSY; - orb = kzalloc(sizeof(*orb), GFP_ATOMIC); + orb = kzalloc(sizeof(*orb), GFP_KERNEL); if (orb == NULL) return SCSI_MLQUEUE_HOST_BUSY; -- 2.17.0