Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2783346ybl; Sun, 26 Jan 2020 10:38:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxrf99cta6Ay4U30L5jN7RNcchhj8LALptwChqU6CUdcVZOMFxiBewl6bjb/NGGShJz+mDv X-Received: by 2002:a05:6830:154c:: with SMTP id l12mr9848234otp.275.1580063882808; Sun, 26 Jan 2020 10:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580063882; cv=none; d=google.com; s=arc-20160816; b=SlH3r4OfQKhhgiqK7mb+q6rhcTV7clG8/K9x2UdKf3VvjOkyrcQchSfwDTDPSh3GSX b15Qvx0f+FBAXFyC0NH8M/PDKJKifVQxTI40s+iSw9TqEHM+nYdg6WaX3GwkXekgajBq ucafXgTSMOyJHv+sy7+csF/IV1FgIVWgA8katRTA32LFVZaIkQczeeSpHQKzx8Ae7I6h meSMuzVjI6wDOZFUlZ3gSGtH0RbPhaV/x7fZf7VYVO0SZoBPbQQL0Y4FckIuLFY20Xfx 9csnCCl6ASn7xDB4UNCSZLp51PuovhIQxIqJFi9J3wxe7FlzyRaZBykED++1sZej2/BB YPQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=m34FWnc2orhl+bfuSo12tg7sQBESN6REG8O1jhCU6Ko=; b=1LIVqMrfoT7r36mzVL9E1zWZ4CvXTDq/mapoFE3u3hOpdFpT7ztS9I/OUD4GUfR+uT KLgyB461fS9Ti4oL1VIPDnFyBFAge9tcu+XBEC6XQMNK0Fk+zKcLvOE3yqxoNlOP5O5h SrkqOXL8EgBrlko9Cw0f2Ukp6aULAoMsIlvFOo2rPPSCLg+BeXwEyXl7nKumCRa5ZiEe 8T2yU2uGW3+SC24x0/vP4wbRgdy+8H/1KtYyciI+GuAKA9quyv8B8J6l5o6Ka4VOGbOz tLveP5AKZB4VPlMrkA9uk2h7UXjUmVoCI3x1HA0AjVYuzYtft3SxaUo1Zv4VgKYS1Mcx rttw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OyPqZHwy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si2012416otg.56.2020.01.26.10.37.50; Sun, 26 Jan 2020 10:38:02 -0800 (PST) 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=@kernel.org header.s=default header.b=OyPqZHwy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728847AbgAZSai (ORCPT + 99 others); Sun, 26 Jan 2020 13:30:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:45380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727233AbgAZSah (ORCPT ); Sun, 26 Jan 2020 13:30:37 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA16C206F0; Sun, 26 Jan 2020 18:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580063437; bh=IeQGexIT5WZnRinFdIJYWHpbxRm7H11XzhptV9yLbpU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OyPqZHwyhFaf1WhFfb67oyG03LfqZktOW7s0kdsxcEOx7zEeXVF8nz0yXZJkBIoLA +GB5nza4xPb4Ddkh/gzf9xNsoiMpp6kBYW/xBo8QGnUtT6/gfWQSJGrCeUG51U9lq+ sbbX8jgApxNQZ8Q8n9duXUENZPQ+m/FaBDP6Y4Go= Date: Sun, 26 Jan 2020 19:30:34 +0100 From: Greg KH To: Saurav Girepunje Cc: vireshk@kernel.org, johan@kernel.org, elder@kernel.org, greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced. Message-ID: <20200126183034.GA4086664@kroah.com> References: <20200126083130.GA17725@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200126083130.GA17725@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 26, 2020 at 02:01:30PM +0530, Saurav Girepunje wrote: > Fix the warning reported by cocci check. What is "cocci check"? > Changes: > Why add that line? > In queue_work fw dereference before it actually get assigned. > move queue_work before gb_bootrom_set_timeout. > > As gb_bootrom_get_firmware () return NEXT_REQ_READY_TO_BOOT > only when there is no error and offset + size is actually equal > to fw->size. So initialized next_request to NEXT_REQ_GET_FIRMWARE > for return in other case. > > Signed-off-by: Saurav Girepunje > --- > drivers/staging/greybus/bootrom.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) As Johan said, there are a lot of really bad "static checking" tools out there that can not properly parse C code. Always verify by hand what the tools said is wrong, really is an issue before sending a patch out for something that is not correct. This looks like you need to use a better tool. greg k-h