Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5586164iog; Thu, 23 Jun 2022 00:48:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6nlGKWl90sSVkdbiofzfhx9jGQOdZAT9kfQWzLJq1SsTDGOHPLQXz28rVMhEfts5iSEKB X-Received: by 2002:a65:4848:0:b0:3fc:52c3:6ca5 with SMTP id i8-20020a654848000000b003fc52c36ca5mr6377286pgs.264.1655970510457; Thu, 23 Jun 2022 00:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655970510; cv=none; d=google.com; s=arc-20160816; b=N0HJmOQojN+qf+HstPbARsENfyBl5Xfr4mfnKWlpIE5YXdvg3CzSDmqWDX+Xl/Tyvl lTL9TfOiVEQdDu2KF2w6rauAtOrumJVLBfVEdMS1GKViAkw9toTxZ/vMzsBS4qoeQdnZ /8B9pTftVmz2Hv5aTh9KaONt45WLOB7/K8gRhz5pNALP/A5w8JRGKSDuUFXOm3xEcVGP SC0sXEMR9kIYgTw302pb0lD14v9iyTmjcRBu7M59HWGuA/j+Puai5Yq3hhx4Epp5I4CV KcYUcVghkIMYCsGnVsAGpMWym+SOZetqatFztePT+2LZRL4h8shOWQfoOEsrYvbjkDzt OpuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eKBW9H1ipw5D6InzcUEpxszcfSZjXw6FGB1yyi81oFU=; b=SyEzrw2IYvSx0brtus7utq9ZYkK2mGrXdHIv3QknJ1We4JfHVfzn/G/QzxZQg0qNaI 7mqiCuwQsARm1udAwOpO/LA22XbGozHaxh8Z/IzgiUJzuXcE8Rb3g9CT6gje5InRELxz 42t9oMyvOXdT5Yh0C4zkZqCCR1bytB/iZVdcflrxXAh3cl9WHyMkIxRy07KNARF9mG63 Ap3vhD3GjT74feajQwtQlFU8KQveWk8ucJt6Rr7HYNxSGM7TstBiHmZ6W2HzdBw5lDy0 sCVHKBbcUvo5QjdoEw7hWcCo7FTrBL8iFqxOBqh8oWFlbao52EY03qVCoPPjjnV8ukCe lg0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=GzVxkS+L; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u9-20020a056a00124900b005254abef688si3965698pfi.239.2022.06.23.00.48.16; Thu, 23 Jun 2022 00:48:30 -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=@walle.cc header.s=mail2016061301 header.b=GzVxkS+L; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230230AbiFWHUi (ORCPT + 99 others); Thu, 23 Jun 2022 03:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiFWHUg (ORCPT ); Thu, 23 Jun 2022 03:20:36 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC4614614E; Thu, 23 Jun 2022 00:20:35 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id DD66622246; Thu, 23 Jun 2022 09:20:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1655968833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eKBW9H1ipw5D6InzcUEpxszcfSZjXw6FGB1yyi81oFU=; b=GzVxkS+LezyIoK4bXT41RdLKRiHEIEPckWglCQIhmFe+D2lBfKsD8GwugWevlAv7pspQBX 28M2BdypdCWxfDu5uNWo2NERkFWXS5JH/FkC3Ok7pDWPtmsomoFgeEeEyA1SMKqKfmou9+ rDszg7QMidQ5PgsEVJXJvrHuN6siCdo= From: Michael Walle To: niejianglei2021@163.com Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com, hkallweit1@gmail.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, netdev@vger.kernel.org, pabeni@redhat.com, Michael Walle Subject: Re: [PATCH] net: sfp: fix memory leak in sfp_probe() Date: Thu, 23 Jun 2022 09:20:23 +0200 Message-Id: <20220623072023.3637671-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220623070914.1781700-1-niejianglei2021@163.com> References: <20220623070914.1781700-1-niejianglei2021@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Hi, > err = devm_add_action(sfp->dev, sfp_cleanup, sfp); > - if (err < 0) > + if (err < 0) { > + sfp_cleanup(sfp); > return err; > + } Better use devm_add_action_or_reset(), no? -michael