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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61C8CC433EF for ; Fri, 24 Jun 2022 11:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbiFXLpG (ORCPT ); Fri, 24 Jun 2022 07:45:06 -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> Precedence: bulk List-ID: X-Mailing-List: linux-usb@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