Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp676589rwr; Thu, 20 Apr 2023 05:09:19 -0700 (PDT) X-Google-Smtp-Source: AKy350YdJjYEeOc6+OIWYB7F05t9uPxys6SgydDFP4zBQZDMNrg9z+V9RkTOSMMS04lI4JWeW2ub X-Received: by 2002:a17:902:ec91:b0:1a9:2cbd:d24b with SMTP id x17-20020a170902ec9100b001a92cbdd24bmr1518850plg.50.1681992559603; Thu, 20 Apr 2023 05:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681992559; cv=none; d=google.com; s=arc-20160816; b=nzBYLVb63R+1DP49G4HqZuNv6xKkLYQHbbB5gl4xQetR2DmgWqljyQMbFrryB5wBWT 8/+Cb6JNz+Pzt6FPjWFDE5ZA/Ev/nP+kFfVXlRJ9w1VuhX5Cb8EXoerjnU5GxWfR9tU3 f0q2DEANB6E06rsg5b2Ft8sLrVDDylHtRUrFsAH0lV68dyKjv9TJp0kphsQHbz5dgzLZ mNQLIVM9x4dj73GOgUnpExREdHRfk6+10Hbz8PsepWGNNYbGH+JH+lv3MBQkL37COCyl qbhmBThFmc7PelY7ky842iaLtPIPQxF7qwhhLzI09UoCEBESVyK8zaqaMC5t/oVzcZH7 FpIw== 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=oJ0NxYUgsv6PNBg19cBiwEHHvsERx4mRja3I48IqkGs=; b=qToYXOjlUUQ6aTq90z+HgFlAv+OT2S6buRJrPDYwK7M0hOZtb+CuhZAa9UptOnvI0X j6m+Ii2rqVKQi0OMfyon3H6S3iMs5PNGqxhqSGQAsEuszVMM7b4P4d8yfsl4Jv57TkxT KHvKTu8qD/KvSgYw4lVl3uY1JtrQF8Fpl50iJvC89P9oGZikgWhoyo8zM9iZM143bHb1 Vu0CY8wQT8PnYIl8stvwGXwKYhCLbOHTufbukX2NE7A5PbtfDd9XgAYwUxAiyugGehOb 25l9Nm7DUXqTMPpzcmFVXg9L8Odn0SZqYAJsTgAQ83+hDQJRNE3c58LT1vk76O1oEi4a jJ/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fiKlQOsw; 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 i12-20020a17090a974c00b0024769a264fcsi4329856pjw.10.2023.04.20.05.08.45; Thu, 20 Apr 2023 05:09:19 -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=fiKlQOsw; 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 S234052AbjDTMEx (ORCPT + 99 others); Thu, 20 Apr 2023 08:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjDTMEu (ORCPT ); Thu, 20 Apr 2023 08:04:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A92F530DF; Thu, 20 Apr 2023 05:04:49 -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 42DEA64776; Thu, 20 Apr 2023 12:04:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55188C433EF; Thu, 20 Apr 2023 12:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681992288; bh=Eq90CI4WN6vboOUFC74i6leDtzHtPyCNTordr31Nh5o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fiKlQOsw4F4vu42KLc/ZfMNSl8Od8i4py8ZDfpWqtAq8dnzttU1JaITIf7m5ITzfe lT7Q4v8RPIwR/85AVtgoN4sXH2sUp/jU2sfl0IOXn3uEobrOvDZmesPYzKJ5EthERu NaHgYdv4TtS/llPUZdhNaYpmHvxzqaR2CCFVcTrA= Date: Thu, 20 Apr 2023 14:04:46 +0200 From: Greg KH To: Kumaravel.Thiagarajan@microchip.com Cc: Y_Ashley@163.com, arnd@arndb.de, dzm91@hust.edu.cn, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] misc: mchp_pci1xxxx: mchp_pci1xxxx_gp: add unwind goto Message-ID: References: <20230409124816.36137-1-Y_Ashley@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 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 Thu, Apr 13, 2023 at 04:43:10AM +0000, Kumaravel.Thiagarajan@microchip.com wrote: > > -----Original Message----- > > From: Xinyi Hou > > Sent: Sunday, April 9, 2023 6:18 PM > > To: Kumaravel Thiagarajan - I21417 > > ; Arnd Bergmann > > ; Greg Kroah-Hartman > > > > Smatch reported: > > > > drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c:73 gp_aux_bus_probe() > > warn: > > missing unwind goto? > > > > In gp_aux_bus_probe(), when the allocation of aux_bus- > > >aux_device_wrapper[1] fails, it needs to clean up the allocated resources. > > > > Fix this by revising the return statement to a goto statement. > > > > Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for > > the PIO function in the multi-function endpoint of pci1xxxx device.") > > Signed-off-by: Xinyi Hou > > Reviewed-by: Dongliang Mu > Reviewed-by: Kumaravel Thiagarajan > > --- > > The issue is found by static analysis, and the patch remains untest. Despite all the reviewers, this patch is incorrect :( Please test patches, or better yet, restructure the code to not need to bail out in such a "deep" call path so that errors like this are not an issue. thanks, greg k-h