Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6642174ybi; Sun, 21 Jul 2019 22:46:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQpU4wijUL/bnTI6zzzq/s9q50tbdMYcvL1cv3HC4mlM4a4AOow9h6K/3yv5Ge3RHrVAVU X-Received: by 2002:a63:e62:: with SMTP id 34mr68884089pgo.331.1563774380183; Sun, 21 Jul 2019 22:46:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563774380; cv=none; d=google.com; s=arc-20160816; b=OMWGxgWKXdWebTvOio/MGTx2tvUKDANo0CEh1RhhDDAcy/8q3H5h9oEbAA1xtz3lT5 RSJhtkWZWYl3GliDvXpiL9qQSrV8R3DrNpHY7/K/WUIhlEaM9Fi/nTVnfF2AsCAs1Np6 msRKDBeHwK2WLyeqRo/I06YR5VhoVFpAXAzq/0ktXrHjf+8Zg04udI1BkYqH3H77MUjU 6c30DM6AdJbZRhpiEzjPudos+xNse9BYLnpuUvr4CWmeIec6ZifTvUDZxXFQVKNubS7O w8AhM/iDqDMO0ntWrMyGVj2gMKaoT0jV08fEdfm/AV/qgKPr9P1oxQMck5isVnbKBbLj 8WdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RCQRh8f7Am9Pu3Zrt8ca1tiYCAmgZh8iO4K+Ia+HeDY=; b=O142mlxlHzQrGCtdIUkCRrc7Dq432BPo5dKidY6bayXfR0BnyYXZHWp5MfjHnxOj9e gA+gN8jwjKdRhNGBPaUOB5W8J+ZCBi7uKgDvKRZ8FKeiDus1J4Ypci/fH+6JUkmc+UEt en0nyHxZYfkVVU27i3EDRZ9x/Q4JN9QuO9/lT8J9nIg3zIWJtCSMKrmH0uWn1wpBiloX q112aQL1AmZE2fycAU8syLCDkvHxhhPZGw7mObIcZTLQGI9ie6P/MDlkGVM6qtbtc228 jb6YjuvSZr36FLfwUD+0bEry562n5f+yDML1hRHKLHvkXzGOOvNKehXQcdssPaZHzOuQ pw+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R6TtVKr6; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si10203033pgq.555.2019.07.21.22.46.02; Sun, 21 Jul 2019 22:46:20 -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=@linaro.org header.s=google header.b=R6TtVKr6; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727243AbfGVFnr (ORCPT + 99 others); Mon, 22 Jul 2019 01:43:47 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34453 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfGVFnr (ORCPT ); Mon, 22 Jul 2019 01:43:47 -0400 Received: by mail-pg1-f193.google.com with SMTP id n9so10885682pgc.1 for ; Sun, 21 Jul 2019 22:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RCQRh8f7Am9Pu3Zrt8ca1tiYCAmgZh8iO4K+Ia+HeDY=; b=R6TtVKr6FzRXGzpuk4JA7iix7Rqg/Vj3Jml5vRJxELGIZUOhzNNDE+ORehUvK5+iLl 34dKdx5dh9Ut0OilqkR3jl7qf3z7nuSnyrxQ8X2g2ylzFyyNI4ARLewsc9mz0zxcRZQM FTDztbAtB5f93ji0gTdc2ocUGsq7LyRPCPmvutWPqOMLAk10C9bb2DEfH7e6ues1cx7A zDuafqss/khT0E8w7sdPyVOIhJjuI+SmronKkfeqQcxZVefr3Uqhk0RE67MOLgJelL1X fa3xSvPr/Ax34q1v2Ns7ZtFNrwZbgdS8LWKdoOy07EMDUdiRuPJWE7SPLKUTucmknMOV ZIEQ== 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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RCQRh8f7Am9Pu3Zrt8ca1tiYCAmgZh8iO4K+Ia+HeDY=; b=uaJ46yzUqGTNCRqnEcQK028LvKI+Y8y9MQgsK0g1YroaN3cFhXcH5Welkzj9kchVjC eK1mJTK6AiHFFckfI7f/Xy0q/lIr7dmGXGxOKeUHJcHhRNaZdNg+A50s6NiCE9cyakwB hSTkB+bzJtq5Bb3jIdNqe/Uk3xZxA1Jvt7fEJopmFLycBQbrcDmj/uyZkUbgC8Yw1l3Q /gbYtTlI0Qa4Q52snHhvhRmmK2CClE6iTKOoX4fCzlTmFKfs11AipsSECViZp0dnSSAk +F9YbqsZdWaYD9RIbbcuXqYltS8j2edp7UZSouy0Pw10tfSO2qG48mRqxtYmDei9xXek lVlw== X-Gm-Message-State: APjAAAWwQ73K5oIJUHXZwdD6SJ5CT+vudMX30Cl9GuFS2HopWjWFrAzN ipc/9xIBqKjKdAz29gyR7c5EWg== X-Received: by 2002:a17:90a:fa07:: with SMTP id cm7mr73019980pjb.138.1563774226648; Sun, 21 Jul 2019 22:43:46 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id i3sm40833413pfo.138.2019.07.21.22.43.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jul 2019 22:43:46 -0700 (PDT) Date: Mon, 22 Jul 2019 11:13:44 +0530 From: Viresh Kumar To: Hariprasad Kelam Cc: Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cpufreq: ap806: Add NULL check after kcalloc Message-ID: <20190722054344.w3vxrxaozd2tuajd@vireshk-i7> References: <20190721180815.GA12437@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190721180815.GA12437@hari-Inspiron-1545> User-Agent: NeoMutt/20180716-391-311a52 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-07-19, 23:38, Hariprasad Kelam wrote: > 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); > > /* Applied. Thanks. -- viresh