Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6179871ybi; Sun, 21 Jul 2019 11:09:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyo+D0hTN47t1nRpNFOgbUpT/Ol3z8BA2E9l0QIKHBZ8dIGTX/6lKRlKxVKC7d1a902JTo X-Received: by 2002:a63:e54:: with SMTP id 20mr66166183pgo.244.1563732588194; Sun, 21 Jul 2019 11:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563732588; cv=none; d=google.com; s=arc-20160816; b=tOItDbZhI9wGekzGS8xi6cSItAaN6v14GDO8TYHvuTldtbPavNXqThPGpDeLa9oeo/ ZXg8q1iPmHq9t2fz6nAvzvGt/regvz24ucF9CQGmW7dqKYw1EG24tGnJHQvcparwHciy bO055DX1/q0nBkvmSGHeHvs4/FSC3EGyzUbyda4HyIJQmUAXSe1pxCP2RU3GnF6ih1/n 5dtzGXtllMqvsAbKTOrKjqMNVr/nctWbAbpWt/oK7bSPzmu2eJlkezNKj52EcNT+3RuS on3zxmzLekuihVXFtLQ782Xj0zE4s0ZCf3E0nJdmcH8Osva2kWDrdZyWoxfkZrDRgmzS U/UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=FTXdst5R/SQuzieJLsSNsjPa5PEZl3NiZMobkmxYQpo=; b=sG6ZwWRZPisW+bN6AhGXdzdYl6J5ISxg+ch+DwYEly9HfCtUGI5kIKCDMLXKIjhOGG sPSBh9K1/oCmZN1/b5sd1Kcpi1Z+nv+OC2YVnN8myoZPbiePvoUEJzBeG75TrdY65d6U 1ckrNzcsuqZhwik4IlyOcCUXDorjZ+3hZftOCBudRDy6rENndQQ1+tave1OgL8OtAjOk GQ8YU+oYGhdUaFT7Z0xfknlIK+Jv6Rana99Er5LoVSm47D5jiUZT9FV4ehcRxPNdtZ07 RfEcb1oVJmDXoAaTTUl8lZmkIkrw3HB0pliZXmxN7xrk5kKRsjlSvOFxtSYzNXkHF1UV mv0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="TTK9qK/8"; 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 b6si6190421pge.44.2019.07.21.11.09.31; Sun, 21 Jul 2019 11:09:48 -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="TTK9qK/8"; 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 S1727043AbfGUSIV (ORCPT + 99 others); Sun, 21 Jul 2019 14:08:21 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46424 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbfGUSIV (ORCPT ); Sun, 21 Jul 2019 14:08:21 -0400 Received: by mail-pg1-f195.google.com with SMTP id i8so16514454pgm.13; Sun, 21 Jul 2019 11:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=FTXdst5R/SQuzieJLsSNsjPa5PEZl3NiZMobkmxYQpo=; b=TTK9qK/8sWitI8E3pN3YavfH2FqVB/+VQYItc84o0fD/vpZ1OeI2c8c0AWWZhLBkfR bEXAb5KG8cL2vk1SsPpFStibPjEpYFWeIEzSlkL4PQCDm3mDXuaZuASgZDpRySce1/uj 8j0v1I+MrFW7tZz0fDRiZDtQLtkKoBwTG2zZV6W2A50fIw7k6caFg64Ut8WzOhK587PD za4dfniHkJZdkWRUilpR+08mlWSsjoijWSqllat/ql6W9CfLJF/DW/9VwROFGk/jfzMf 8LMV2FSt4zR5LXXJIZSE8/u1NbFUmRIXPLXteqUj7BC0iwhNG5mCfH2oXw6U8toPMo5b hRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=FTXdst5R/SQuzieJLsSNsjPa5PEZl3NiZMobkmxYQpo=; b=rsUICB8mLcTdcL7lENBo6UWkujoUBhU+EeoZI/AvmJrbkKuQoBUWqWOGaSmlploHa+ D66xP3NKW/ncjy0pbuklPxv7W2TS2CsfNn3rSq2OICWawo4qZX1E06NagfwA7eneH93m zGdGYCep1y8f5illLPTET2R2fDmtxTvomJZ3PecQBre0OtXe7zoLkw8eY+IdLrj4jVFp V8JxO4V3qX9wLs92PfUJz69tihzcQfZA7V1CIHoINhOlb1vIYJjKVY/3ANcCN14eeFaI uEQ49xzJ4Ff/yGQhd8SmQYEqMEq8n9mtTS4D092EttdZr48xHT+v2wfxcL1Tm22j6xZb AVdQ== X-Gm-Message-State: APjAAAUg6ITS44Z4CsMltwEG8OS2bKntACXNgDTXBspXp12+68JkJmgC tTYupBKotpdlwggxYbzujEVXKHnE X-Received: by 2002:a17:90a:228b:: with SMTP id s11mr70837355pjc.23.1563732500738; Sun, 21 Jul 2019 11:08:20 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.86.126]) by smtp.gmail.com with ESMTPSA id m31sm44011625pjb.6.2019.07.21.11.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jul 2019 11:08:20 -0700 (PDT) Date: Sun, 21 Jul 2019 23:38:15 +0530 From: Hariprasad Kelam To: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , "Rafael J. Wysocki" , Viresh Kumar , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: ap806: Add NULL check after kcalloc Message-ID: <20190721180815.GA12437@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add NULL check after kcalloc. Fix below issue reported by coccicheck ./drivers/cpufreq/armada-8k-cpufreq.c:138:1-12: alloc with no test, possible model on line 151 Signed-off-by: Hariprasad Kelam --- drivers/cpufreq/armada-8k-cpufreq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index 988ebc3..39e34f50 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -136,6 +136,8 @@ static int __init armada_8k_cpufreq_init(void) nb_cpus = num_possible_cpus(); freq_tables = kcalloc(nb_cpus, sizeof(*freq_tables), GFP_KERNEL); + if (!freq_tables) + return -ENOMEM; cpumask_copy(&cpus, cpu_possible_mask); /* -- 2.7.4