Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp330487iog; Fri, 24 Jun 2022 05:03:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vquyf+q7Kj8jCMDgXfd2aqgcRGDcgU+xAbHfGMa5mtl6xSiQelKeu79voK6+9f7D6J3jFq X-Received: by 2002:a17:907:7204:b0:722:e164:933f with SMTP id dr4-20020a170907720400b00722e164933fmr12709431ejc.768.1656072197489; Fri, 24 Jun 2022 05:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656072197; cv=none; d=google.com; s=arc-20160816; b=LLnvsCAr7qC5K5mEKSQwSeMRvacMChP3/0OwpOXh1YJmdCMlG6DctHN+MERIA6CuQe MezBbrU/AWwMqmjmKlRUewngOApvNWd2eIqISUUzDoeV/bO7RV2eXUQdpVUIK4d5W6A3 LFDCrogfsIyiXFi+pdYBKQ31+r5iMKh31hwVZWhJygA2QsfLnolFJ6wD1rxhL0ZFWNnj xE4RS81AVezVEsOI9U67VKnr5xXd2rSL+rrnVlWqSm3yxss1S736pRaGxIOT12GYah9f 3mMNuPDcJHQfHNuDj/QvpqoYUbAK60wPMIQ56GjhGG2RdR2QQ5NMPkwsK7uZFLvDj/Lj vHkA== 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=6PDs7ktQz2tx8vPTp99tModgb7teBUDN47iKdyWMzDQ=; b=yYEta3TrscW21a9iw9lhXnC2i/AjkSg7rrD27uZTEteLQXDkXZUilNIwcc85b2+A7L zrHg8qmhq/a9EjhHzFQh0nTSHYvpFL8IbvqaLWJTQgHbqDiH3CK0xo0HfSH2aELI9ENO 7TW3jSH6q4n3eX3onVVWhpSrLX8QdqnS3n5rEyF3bIIf5NYS8KWNuzDFE9xbmWIhiJWj cGmIvrC6XU3XK3rAOYmAG69Oxkz8l8zVPkpAeFuMFrIthJ53ZpAnVW9K3fW8CiqF/1x/ 2S5fcABRf1xeXdFwefz2qxv/JH92QxYYzGnYV8D6lH8zF9BF4IgZY8t1SchiFoolil9C GH5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jDFVvIZP; 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 ji17-20020a170907981100b00726258930e6si2512398ejc.459.2022.06.24.05.02.51; Fri, 24 Jun 2022 05:03:17 -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=jDFVvIZP; 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 S231690AbiFXLpH (ORCPT + 99 others); Fri, 24 Jun 2022 07:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbiFXLpB (ORCPT ); Fri, 24 Jun 2022 07:45:01 -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 D8A977A6FC; Fri, 24 Jun 2022 04:45:00 -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 78DB162229; Fri, 24 Jun 2022 11:45:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EBE7C3411C; Fri, 24 Jun 2022 11:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656071099; bh=/juf5uhRx4ref2vuTs7Hpo06T65AVQbyQOqQDhjmWU4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jDFVvIZPp4ipTFbNzLCLY2ngcLnNYWoXHX/GzPbN8cyROyLW4td75MRwsyhRgn7zM cXka7AsavQuuFK7GAbINaUSf4rveA/+sfSUqHie0Z6MF2T0DGDipSwWMlGtc/iyfVa AmWiS7kApkn+paPWGLqt7+XBVclDlrb0caJvhd98= Date: Fri, 24 Jun 2022 13:36:42 +0200 From: Greg KH To: Jiapeng Chong Cc: lewis.hanly@microchip.com, conor.dooley@microchip.com, b-liu@ti.com, linux-riscv@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: musb: Fix missing error code in mpfs_probe() Message-ID: References: <20220624072515.123646-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220624072515.123646-1-jiapeng.chong@linux.alibaba.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 Fri, Jun 24, 2022 at 03:25:15PM +0800, Jiapeng Chong wrote: > The error code is missing in this code scenario, add the error code > '-ENOMEM' to the return value 'ret'. > > This was found by coccicheck: > > drivers/usb/musb/mpfs.c:185 mpfs_probe() warn: missing error code 'ret'. > > Signed-off-by: Jiapeng Chong > --- > drivers/usb/musb/mpfs.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/musb/mpfs.c b/drivers/usb/musb/mpfs.c > index 99666ef8af06..c8bf6570bcc4 100644 > --- a/drivers/usb/musb/mpfs.c > +++ b/drivers/usb/musb/mpfs.c > @@ -181,8 +181,10 @@ static int mpfs_probe(struct platform_device *pdev) > glue->clk = clk; > > pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); > - if (!pdata) > + if (!pdata) { > + ret = -ENOMEM; > goto err_clk_disable; > + } > > pdata->config = &mpfs_musb_hdrc_config; > pdata->platform_ops = &mpfs_ops; > -- > 2.20.1.7.g153144c > Dan beat you to it, and provided a better fix: https://lore.kernel.org/r/YrVmLEc/FOEzNdzj@kili thanks, greg k-h