Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1374052imw; Sat, 16 Jul 2022 05:19:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t/Zc9Tfx2zFggG3DuWj8WzOEenzZefOmPywfsNM4yVDjwCz1H2JfHIFEdHWAOmqUreJ+1p X-Received: by 2002:a17:906:9b86:b0:6fe:d37f:b29d with SMTP id dd6-20020a1709069b8600b006fed37fb29dmr18153627ejc.327.1657973983654; Sat, 16 Jul 2022 05:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657973983; cv=none; d=google.com; s=arc-20160816; b=w8Orqffqp3rVq6C6jl7Q+VNQteeRw6z8goOhuwhNt2JDbl9CWaHK+niNHnTRaoHTp1 A6TvGl1HzbKCRmvy7BmMh8TtCm0Qk1U7MaHMKTlGjbQ9cVW5D7XYxBIqoqKEoeFkv8TI SgpkBCwl+ibxYqFwVVUjJntjBUPonlgpTGr3phvaEswBtUo9OkmGPzVQ/5+JCFshFLyy 8gnP5WbpcdjAlppxrFm0mATpK4kOfI7LzKFmJt6iBKkQ2wNT5AnsDm+2fC5/UolN+CtM HPBOVzZ3bVnGtnQD/jQNZ4g6bCYnM/c89l3YGtcRzNCyIP5lwPME+FKSBTYOu1XdQ0Ci kc1Q== 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=j1WSywbEtdZm0bNJoSQnYmBelRxlUIGmAUGB9cJ0IRg=; b=rlDOMgxXqrCpr8TSVXwnPcEhMhrPXaaA7hXHLWmtEXS7hMjlJImoKDuNz97GBCfp+4 74ByMqpK362Ok3jKq9iUwXk9MnZUvDSThp5ettq1nDq0H9XyrL7sAsaGJ6MyOm9nzg38 MVWndEPl36rP4wAGne55FgX7x/Hrbl1hvGooH5gbeF5iC/0AH16Dl5x5qag7o/AMRT7X dg3DOuMmkbjmY76FQqqfCyajIj+dwidJnx+AnrcebEDzppWdPPIYlDzxa+H/nKLQ07lI rH7/bIzywtIu8lIEG/5z62u4l1vtPy2qZBlUkz80FhimpHQ2st9cAewtE1zCJk1LvIV4 xU5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H2SAJ2Rq; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a05640242cd00b0043a739b4b93si11233489edc.303.2022.07.16.05.19.18; Sat, 16 Jul 2022 05:19:43 -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=@kernel.org header.s=k20201202 header.b=H2SAJ2Rq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbiGPMPF (ORCPT + 99 others); Sat, 16 Jul 2022 08:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiGPMPE (ORCPT ); Sat, 16 Jul 2022 08:15:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE8E31EC53; Sat, 16 Jul 2022 05:15:03 -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 7A2BC60FC3; Sat, 16 Jul 2022 12:15:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51E99C34115; Sat, 16 Jul 2022 12:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657973702; bh=I60693levZgEbb4nb1eqggLV2fzh5jOMm8Vl/zFKeKE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H2SAJ2Rq3xmZyuA+a0uaSo681naNkNP8WHOxCem+kY3GVjH5LMFA/hOWkk1vI3lie POGuD21vCRXxNVY/dfbc/ot6SOJFl65MD8ol4rlHDiFlovhJQJW0WWp4AgqfTRHgBe DEQzYYHw1HMVIC3Pzq33fBAlDiosfSDO94uPyOMXsVZf4xHG8Y9qsHBtK0KOf0JBnW pVbAZ8Zi2FuV1MCPIlh4thqU78iwR/x5779qK/t2s/d+KrtiARLf9EgITU23gUa2Bp TtQitS1J0C9r/xZ7x/ftezQj0Z3UfPsI1BK1yWW0ntvlJpV5z/cRHltSJEJsqbckht Mf0skPURxJ/sg== Date: Sat, 16 Jul 2022 20:14:56 +0800 From: Peter Chen To: Andrey Strachuk Cc: Pawel Laszczak , Roger Quadros , Aswath Govindraju , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: cdns3: removed useless condition in cdns3_gadget_ep_dequeue() Message-ID: <20220716121456.GA238342@nchen-desktop> References: <20220711151032.16825-1-strochuk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711151032.16825-1-strochuk@ispras.ru> 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 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 22-07-11 18:10:32, Andrey Strachuk wrote: > Comparison of 'ep' with NULL is useless since > 'ep' is a result of container_of and cannot be NULL > in any reasonable scenario. > If ep is NULL, the container_of(NULL, struct cdns3_endpoint, endpoint) will not cause panic, but later ep->desc will cause panic. So we can't delete the NULL check for ep. Peter > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Andrey Strachuk > Fixes: 64b558f597d1 ("usb: cdns3: Change file names for cdns3 driver.") > --- > drivers/usb/cdns3/cdns3-gadget.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c > index 5c15c48952a6..f31b389ae0b2 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.c > +++ b/drivers/usb/cdns3/cdns3-gadget.c > @@ -2608,7 +2608,7 @@ int cdns3_gadget_ep_dequeue(struct usb_ep *ep, > unsigned long flags; > int ret = 0; > > - if (!ep || !request || !ep->desc) > + if (!request || !ep->desc) > return -EINVAL; > > spin_lock_irqsave(&priv_dev->lock, flags); > -- > 2.25.1 > -- Thanks, Peter Chen