From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45A6CC43334 for ; Wed, 29 Jun 2022 12:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0pFfV/Ty0XvOfJSfe6ELgY818y+3qLtBzqNNioEk8Ks=; b=ghrnvaCQeUvZA9 XOGT9XdWzcbeSZQKay9IUL8wh0JzWiwqYBONQktJj9lneOzoDxH8ynVooVliETVQ+frZBP7boGpBS BHo4l0PNaPNqUKKWlO8iMDOYunu1mT6PWXLVBYaBxqzkHXEiTa9T75pRGVdPVxhip5PmK2ONXw+/M xxQuyedPB4gAzS3DjSybuiFmlCzWL7D5uOFgSQTFtW7dV8x1cWj8V26MsXN/MzUUVyVySSNPKg/pj 7WAmlhU48+8BTmmO1DnwOB1ZOfXti/mVDFewxdSPMhDGG37kFm2+Do/t8dX/zsb54RvmRDibbj0q4 Isjzdp0IZdDfzZsSQzZA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Wb9-00BioZ-N9; Wed, 29 Jun 2022 12:15:12 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6Wb2-00Biig-OP for linux-arm-kernel@lists.infradead.org; Wed, 29 Jun 2022 12:15:07 +0000 Received: by mail-pl1-x632.google.com with SMTP id x20so8329856plx.6 for ; Wed, 29 Jun 2022 05:15:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fIylpPsCi1ABfV76nWqOfFV4XRKIutPZz0K9Tp2LFOs=; b=hEgZ7x9S/UmFFpJP6ILkWqIiAIijBVgh/17UnOdeP4h/8EVNVHwK6Sf5QwY9W07TfL fc82dLWOLOerZOEdwY0Gn7oM0fCiArB35bcVUXgdN5JR6UHTPdK21RvIvLYRIV83VMJ5 Dbfqp22pSs2CAcDCHMuatIFTg2Al4tiijmqlixG9WEszg2LRbDKwI3wtkwwZ+uDPBzAw 21flIiBHL8BqfPwbZhZhsWhCinwakwDPQc1NMgPIvBacX2qcwiAWzj9XvtyEqYo68fV9 /GO3GKMrT3gYOuVxA4Y55Mp4TZCguAVE56rnAuwKi2tsvlQSH2J/UYAwIzAEWNdN4R3T IHpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fIylpPsCi1ABfV76nWqOfFV4XRKIutPZz0K9Tp2LFOs=; b=i7y/FyvT0KQBDS1BsMA1ZpQFjlinYstrICRuoz4vjT+h8qUNk8m9ILbfTD8l8w2dJS iMKZ1CVePUOiEMXvQgh7scki5m7pyLq03M1q3as/4Vh+a422rG+qyivUnqnoVO5Rwe/o IweOOt9lmJ5QdQ2nEeTAI7zCF/tqoMthvnMpzVEwjgA1M/1FikrGOtnNGV2zds3I5Ulc 3xtT8b9MY+olKeBOGWe/77dUSsrcl0Yb8GP8KdXOFhosAL+ajR0dNY4BKtjoYtrE6y9K 9POo7FE9dA+lht4XPH0FzYYR+CMDBtS8qh6LtuGOhmn+OlmGfNhkts0SZ0tb7QIYQjBU ftzg== X-Gm-Message-State: AJIora+Xrz3jpGsmEI2hl+n7qy7a9ytRLLmxcx9zz2IzSGz094aEy6wj dFdFU1vJBun5a2+cQhc3ijQ= X-Google-Smtp-Source: AGRyM1u6hbzWp4S+iMWlHW2RimxNvNSEmwFQFCSTNBB1DoA0RlhNEq+qsoUpMlMKYTptqX0hE37lOA== X-Received: by 2002:a17:90b:1b11:b0:1ed:37b0:be25 with SMTP id nu17-20020a17090b1b1100b001ed37b0be25mr3517713pjb.99.1656504902573; Wed, 29 Jun 2022 05:15:02 -0700 (PDT) Received: from sebin-inspiron ([103.160.233.84]) by smtp.gmail.com with ESMTPSA id m14-20020a056a00080e00b00525b61f4792sm6365353pfk.109.2022.06.29.05.14.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 05:15:01 -0700 (PDT) Date: Wed, 29 Jun 2022 17:44:55 +0530 From: Sebin Sebastian To: Greg Kroah-Hartman Cc: Neal Liu , Felipe Balbi , Joel Stanley , Andrew Jeffery , linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] usb: gadget: dereference before null check Message-ID: References: <20220629080726.107297-1-mailmesebin00@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220629_051504_835416_535EEFE9 X-CRM114-Status: GOOD ( 34.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 29, 2022 at 10:24:07AM +0200, Greg Kroah-Hartman wrote: > On Wed, Jun 29, 2022 at 01:37:25PM +0530, SebinSebastian wrote: > > Fix coverity warning dereferencing before null check. _ep and desc is > > dereferenced on all paths until the check for null. Move the > > initializations after the check for null. > > Coverity issue: 1518209 > > > > Signed-off-by: SebinSebastian > > --- > > drivers/usb/gadget/udc/aspeed_udc.c | 9 +++++---- > > 1 file changed, 5 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c > > index d75a4e070bf7..96f8193fca15 100644 > > --- a/drivers/usb/gadget/udc/aspeed_udc.c > > +++ b/drivers/usb/gadget/udc/aspeed_udc.c > > @@ -341,10 +341,6 @@ static void ast_udc_stop_activity(struct ast_udc_dev *udc) > > static int ast_udc_ep_enable(struct usb_ep *_ep, > > const struct usb_endpoint_descriptor *desc) > > { > > - u16 maxpacket = usb_endpoint_maxp(desc); > > - struct ast_udc_ep *ep = to_ast_ep(_ep); > > - struct ast_udc_dev *udc = ep->udc; > > - u8 epnum = usb_endpoint_num(desc); > > unsigned long flags; > > u32 ep_conf = 0; > > u8 dir_in; > > @@ -356,6 +352,11 @@ static int ast_udc_ep_enable(struct usb_ep *_ep, > > return -EINVAL; > > } > > > > + u16 maxpacket = usb_endpoint_maxp(desc); > > + struct ast_udc_ep *ep = to_ast_ep(_ep); > > + struct ast_udc_dev *udc = ep->udc; > > + u8 epnum = usb_endpoint_num(desc); > > + > > if (!udc->driver) { > > EP_DBG(ep, "bogus device state\n"); > > return -ESHUTDOWN; > > -- > > 2.34.1 > > > > Hi, > > This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him > a patch that has triggered this response. He used to manually respond > to these common problems, but in order to save his sanity (he kept > writing the same thing over and over, yet to different people), I was > created. Hopefully you will not take offence and will fix the problem > in your patch and resubmit it so that it can be accepted into the Linux > kernel tree. > > You are receiving this message because of the following common error(s) > as indicated below: > > - Your patch breaks the build. > > - Your patch contains warnings and/or errors noticed by the > scripts/checkpatch.pl tool. > > - This looks like a new version of a previously submitted patch, but you > did not list below the --- line any changes from the previous version. > Please read the section entitled "The canonical patch format" in the > kernel file, Documentation/SubmittingPatches for what needs to be done > here to properly describe this. > > If you wish to discuss this problem further, or you have questions about > how to resolve this issue, please feel free to respond to this email and > Greg will reply once he has dug out from the pending patches received > from other developers. > > thanks, > > greg k-h's patch email bot I am sorry to keep on bothering with this incorrect patches. I am running the checkpatch script everytime before I sent any patches. It is not showing any warnings or errors. Is it because of my name that my patches are getting rejected? I can see a space missing. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel