Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2663665iog; Mon, 20 Jun 2022 01:50:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1teo8smLieeMRYcxk7LrZFExHvkhPOTS+oLxLsVifk2JW4nbImTX9ipKtS3TJ49u7QdDT5S X-Received: by 2002:a05:6402:42cb:b0:435:8c3b:faf8 with SMTP id i11-20020a05640242cb00b004358c3bfaf8mr1332999edc.300.1655715054555; Mon, 20 Jun 2022 01:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655715054; cv=none; d=google.com; s=arc-20160816; b=HVxNEvZLVb3k+hI8BJzEPHC7Qb71Eprre0FJUGDPNhQAnWNIESye6HH816rFjidl+l 7OnAkNHuQ+Y6p2Ch4d5uSyMTjrWWe/GkcSqu5AgGxhRoa3wvxMtkPIkOXmaFwLubdenb OWbjzogMUZDyN9XaadCJS3wQL7SRRC6jxjPUUfYG7vSu/Vt/ktSQqaHHyabA52rZoTAv Uv3u3707ZDK7xLcuwMbt+i//RhtgnP8MfIZheSXaEuTB5SQhcXNU4VCfnGpk4FBZFmxa 7S7Qh6DQZ5QScybdr43yxe+wtwpx0PWIMX1f60XTbDa/m60phtY6GD17CZUdR5FRwo0D qTeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9VpMi+Yyvk5v3FUtgcD4d+CDPnJnqLEy8hjcvPsxzG0=; b=HcggNUcXjrw9cduq7/NWFZ0U5zas0BexONSf3V2lRE2oB9EVPWD9lme3tfI77HZVGE kFSn/20XiUKCLgKgWkDPS4RZh91YQmvSjuLw9cTMcwtleQTw+m6akDp7oueoHTUBPExS 0Y71uqwJ5TXv6aU9i0mG3rNlh9ezYlTLhPXRvWJTFj/wLyivbe0JxFTf4XasG+wAvv7k JQqPYRgmFLhwXFOSIbrnj68gIOTwHamTAR8OXMdEEJqdrWjJKdr7mJ63tLdY7+ceXR9y HELGgmWnaCdmDrss4p1F1LCY27sU6tZrTkyOrHx43Zrc573JFYaGEQN0RUc4qsMyoT8/ TrNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nCl1xAjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb3-20020a1709071c8300b00712128834a9si12993421ejc.501.2022.06.20.01.50.28; Mon, 20 Jun 2022 01:50:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nCl1xAjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239471AbiFTICM (ORCPT + 99 others); Mon, 20 Jun 2022 04:02:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239007AbiFTICK (ORCPT ); Mon, 20 Jun 2022 04:02:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1CA1114D for ; Mon, 20 Jun 2022 01:02:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3AFBC6122A for ; Mon, 20 Jun 2022 08:02:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 183D7C3411B; Mon, 20 Jun 2022 08:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655712128; bh=DwhU0/KxtnYlqxZj35So4aWeWj3iqMidFqPyuGEWOsc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nCl1xAjYaSjiD2yiORDCzx4gxd/Q1ObwVxYAlnPd4KDTvk4uR3JvCEfiAaigmwOHh kboBiyjYZDBKr1ti6TSy02x09OWEoPtBDztSNmtdC+Lgu/+mCHlh7vdItt0U9X3ZCp 8ITi4zITqaFhkBANt3N8buI2jQoI1XKRnQEdr+KM= Date: Mon, 20 Jun 2022 10:02:05 +0200 From: Greg KH To: Souptick Joarder Cc: martyn@welchs.me.uk, manohar.vanga@gmail.com, alexandre.belloni@bootlin.com, rafael@kernel.org, mathieu.poirier@linaro.org, u.kleine-koenig@pengutronix.de, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Kernel test robot Subject: Re: [PATCH] vme: Added NULL check for bridge Message-ID: References: <20220619070645.100947-1-jrdr.linux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220619070645.100947-1-jrdr.linux@gmail.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 19, 2022 at 12:36:45PM +0530, Souptick Joarder wrote: > From: "Souptick Joarder (HPE)" > > Kernel test robot throws below warning -> > drivers/staging/vme_user/vme.c:662:20: warning: dereference > of NULL 'bridge' [CWE-476] [-Wanalyzer-null-dereference] > > Added a NULL check. > > Reported-by: Kernel test robot > Signed-off-by: Souptick Joarder (HPE) > --- > drivers/staging/vme_user/vme.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c > index b5555683a069..ede774f2fe5a 100644 > --- a/drivers/staging/vme_user/vme.c > +++ b/drivers/staging/vme_user/vme.c > @@ -659,7 +659,7 @@ ssize_t vme_master_read(struct vme_resource *resource, void *buf, size_t count, > struct vme_master_resource *image; > size_t length; > > - if (!bridge->master_read) { > + if (bridge && !bridge->master_read) { How can bridge ever be NULL here? thanks, greg k-h