Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp320105imm; Thu, 26 Jul 2018 20:06:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdo4XD4aC2D25Wj05SW07nVvVqxmsFuwQUuhe4eWosl8+uwLhZEnhD2AUzYAln0E4nROJu9 X-Received: by 2002:a17:902:9348:: with SMTP id g8-v6mr4286461plp.302.1532660781588; Thu, 26 Jul 2018 20:06:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532660781; cv=none; d=google.com; s=arc-20160816; b=wzuori4pnLACMxo7VolMxufKQeSIsvtJXOCTh+atPZM5L2IdmcsF1ceUgaDe5PagnO MsXsdOpkil+s1JfQJ5+FS3oWyHXRTRvBJDCo0HpE8xWM+MRUdYFM1OPP10YMChoq4Lh7 733dv2caKGZCIX9sskcLCCJEzcc5nEC7ha6QmVCvRz8OpB4Cb0pT38ImdjgP9nvvNavp CJBKmzJGY6kyoLvcl2FDZWKI4RfCzOakaOgQb1rehysmRpM+RdP5ci9lwPZf/3/MS3y1 fkJ/Sj8ROL9l7ZLiUuFAjB8RqRk6qotpPWwwQPoIi6Jt5JRnrDCX4oqCWXAFkR+tAE3Z Zv8Q== 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=I1w2fTWFH6D5/xRWuf1sz/hQSAip5UyfHVE49QGVzkg=; b=M428Fov8hJpGqf1PO+w+F0OfDQOMU5En2V8Oiy7AKzltxfnvKkXs9K/1e4H0oBFH0V qXsQdHmPUN9LtRAKGEuBWxFyo+GFbM9/RqHt6PpfJNf/c8GrwN4oD0yBWdKyQtGJIvEV JAC0CJLa4HHNB9QV8O7QNUQscbIH7hd2Yqizh2KWL/8CiSjsVl/LtY5ja1eZh7nTDM8X ZNWvJntzvV8mb6i0sT+GxCaLW5YDtHAMsYzt0Ce536zIr15QjfEXLjmKMdF9rYW0BscJ lKpt7mIfdkp5gMY4De7I46Q6emxytoWe4Hg/Cq8VOPZpazE4tkZbTclwYDEmWD6ZApbX jtrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TcHUmRbD; 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 m68-v6si2860194pgm.637.2018.07.26.20.06.06; Thu, 26 Jul 2018 20:06:21 -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=TcHUmRbD; 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 S1727958AbeG0EY7 (ORCPT + 99 others); Fri, 27 Jul 2018 00:24:59 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43202 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbeG0EY7 (ORCPT ); Fri, 27 Jul 2018 00:24:59 -0400 Received: by mail-pg1-f196.google.com with SMTP id v13-v6so2343154pgr.10; Thu, 26 Jul 2018 20:05: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=I1w2fTWFH6D5/xRWuf1sz/hQSAip5UyfHVE49QGVzkg=; b=TcHUmRbDRv/cwZhQ3+JVthMbr7jPjcoHL+AsCW2jqLoLNJV15E8OqAr5oF1SO21TEf 4OvfC/2ZgGxt5DN8i8SlYBkeKV8FPKUVvLbvluwYBAUPu7VrMttwGjqz6oOss9nYnAlh UORpYvHKktpQd41+XFMjIo/zDugr/lFJKNtR9Icqw9MatfEsSB7oNC9wwy5YcaEH7XaJ 8MQ/BasZJ1j0hMdFyyZOHdys50Micz6PsRU2hgU9jN/1Tj2aPVqNTYZ6ORJmTe8s/9/+ Gls4rTX9PC4zJbrfC608nOV6eJalrs63lmDZDPj7tjgt7mrYiAaVKqsRmfcB9oGmNhC0 vlwA== 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=I1w2fTWFH6D5/xRWuf1sz/hQSAip5UyfHVE49QGVzkg=; b=IZx6b7Hmabifz0mgL+SUAFuSrfoaK3EOT2Ni/Abg4tWQMQkteie1sGRGZlC5Pjvpcf 0n1erNNW6QpwOErAR63yQCSSeIB4K9VsiEB+4ygejsJNn8JcQbZex9IsjhfYeBugq1KD uw1w4lUHX829fvgi7botwj8O6TyvKCkFyo149fLc918EbvoSL1nH+lSi2wDe7uBF0Ol5 lmIfCSDSHbRLTDW5VpGmjw/ZXcjDLy/ZMNlyoFQ93NL2pyB6TgvyNUgXjh2Gj+dvpcBp M0nhnVkKYPEeB/rTesWS8ANm8stY0A4ttKPeWCTn9GnqYfmuBS6OLkSNUb/5SuP9evjt VoVg== X-Gm-Message-State: AOUpUlGYGlbaaCIIukfrQoabn1OKb39XJtTRgz66ni/fDj6N74w2InHl 3IYDndwd00VT/LHmeyWcAqE= X-Received: by 2002:a62:4494:: with SMTP id m20-v6mr4696317pfi.205.1532660717388; Thu, 26 Jul 2018 20:05:17 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id n188-v6sm3864532pfn.49.2018.07.26.20.05.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:05:16 -0700 (PDT) From: Jia-Ju Bai To: hans.verkuil@cisco.com, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] media: pci: cobalt: Replace GFP_ATOMIC with GFP_KERNEL in cobalt_probe() Date: Fri, 27 Jul 2018 11:05:09 +0800 Message-Id: <20180727030509.2668-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 cobalt_probe() 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/media/pci/cobalt/cobalt-driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index c8b1a6206c65..4885e833c052 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -670,7 +670,7 @@ static int cobalt_probe(struct pci_dev *pci_dev, /* FIXME - module parameter arrays constrain max instances */ i = atomic_inc_return(&cobalt_instance) - 1; - cobalt = kzalloc(sizeof(struct cobalt), GFP_ATOMIC); + cobalt = kzalloc(sizeof(struct cobalt), GFP_KERNEL); if (cobalt == NULL) return -ENOMEM; cobalt->pci_dev = pci_dev; -- 2.17.0