Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4141614rwb; Tue, 20 Sep 2022 09:21:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TtLceTZ/w2BV9wCKeZm3+k2NNiz8vohcnTYWk+Z6gI982XzShSWi/GfEqmSTURXmjs4mc X-Received: by 2002:aa7:c04d:0:b0:454:2f81:b966 with SMTP id k13-20020aa7c04d000000b004542f81b966mr8330625edo.269.1663690867588; Tue, 20 Sep 2022 09:21:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663690867; cv=none; d=google.com; s=arc-20160816; b=OhSi0VmlZpIs/SPWc1Q3vIj2d8TutyOisE4gIYqCnKhyGZpCwakEqrn7CsQOJNAkqI nvwze87c7QUSUuXgC16EhtPjBXu4d3Df+Cz51KMys1KySyoVF1MiZC5D1oP2eVFPlTn3 sDFLD++a5xtkdKs5dUtimSBq2ooOQaydjrXd6oJTK12wfdFZKfCpUFAN+vVnsjmQiB8g 2T6+ugFLrqASC2Da2TA/ZaLHNTRGX6ULhwvBYtIqLyYL7rkVKZOyGWmHOh8OTyNZG2EQ gpMbSBJJKeYeGGuqVaLiW6RqJ+wYOFbrOLREAN+WDk24i7CEDmWlKIDttmw59EV+HKiM /SEA== 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=fFV8qAFZlnLcPPIjtpdQql1eIIagcKRi3vuAnrYd4rM=; b=QQQoEpxbBMB75bcXTAOqar4qgV3JkpYbIEEKSp1g10Qclv8DKA6UyVdqbFpSnH1Crd NtadCWvBmLNQun0adMas9wIQk4dLdGUnI3mQl4177fb0ZYdCltNu0Ukgas6jB00VbbYH 2ssSlKgsM8Es1JE1lU8kPqNMVp6mKA40i+pjML+230F1WxiNyOkcSB1TgKyI/vN0Unt0 EX99p+mcFV88dCMyeBuub+WOd2tVAsQacXIeJMuRTdk/X71MOZkGnTo9EROK2C5hcY8m bxO0WSurvXdJ17uby/zm+UyrBnCnFWsg010HiEta83+iMjtKoTetTdeztD2AHgEJXxkh 0+PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Rf3dgg+R; 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=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn2-20020a17090794c200b007818378f560si178774ejc.383.2022.09.20.09.20.41; Tue, 20 Sep 2022 09:21:07 -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=@collabora.com header.s=mail header.b=Rf3dgg+R; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbiITPtD (ORCPT + 99 others); Tue, 20 Sep 2022 11:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbiITPtB (ORCPT ); Tue, 20 Sep 2022 11:49:01 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E71766120 for ; Tue, 20 Sep 2022 08:49:00 -0700 (PDT) Received: from mercury (dyndsl-091-096-056-222.ewe-ip-backbone.de [91.96.56.222]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 31DA16601FB8; Tue, 20 Sep 2022 16:48:59 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663688939; bh=1cJdei1wKjC+6amXTIk3jEO0feNqmjSNtSnqcqw4pGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Rf3dgg+RG4YHjpEUCWpS4vOAzt3CxDqy1TNEut8r7jdtYG3JwiuLmejY6CGgRjbzJ PC5DcKH99dh/I0+EEHnV6dJ6DW/YikzjQrV6zpzyYN0yYY10q3LPPloC6u8OwPRtnJ KNqildqUpGCeJS0PMKJzAKbecz+v4FidB4NBzoL/QBN3J3/+mW38iKmJFlkyzKZcIY aPgC7HW69Zn34kfzBtXr6YkTkvJS90oxrrrlbYpj7VGRyEBDaPNTZdm1TVljjwnjXO +icFvJt4Y9aFungijg7MVzuaUbk1M4BWL6Z1UTtMNS/zaTbQiuMZ+A+mXSHwDuhMiB tmkAzOYXnAnWg== Received: by mercury (Postfix, from userid 1000) id A33D310607CF; Tue, 20 Sep 2022 17:48:56 +0200 (CEST) Date: Tue, 20 Sep 2022 17:48:56 +0200 From: Sebastian Reichel To: Jianglei Nie Cc: kuba@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HSI: ssi_protocol: fix potential resource leak in ssip_pn_open() Message-ID: <20220920154856.4s675wv7koivvpgb@mercury.elektranox.org> References: <20220905074801.46167-1-niejianglei2021@163.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="evlazoyrppugj4l4" Content-Disposition: inline In-Reply-To: <20220905074801.46167-1-niejianglei2021@163.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 --evlazoyrppugj4l4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Sep 05, 2022 at 03:48:01PM +0800, Jianglei Nie wrote: > ssip_pn_open() claims the HSI client's port with hsi_claim_port(). When > hsi_register_port_event() gets some error and returns a negetive value, > the HSI client's port should be released with hsi_release_port(). >=20 > Fix it by calling hsi_release_port() when hsi_register_port_event() fails. >=20 > Signed-off-by: Jianglei Nie > --- > drivers/hsi/clients/ssi_protocol.c | 1 + > 1 file changed, 1 insertion(+) >=20 > diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi= _protocol.c > index 21f11a5b965b..49ffd808d17f 100644 > --- a/drivers/hsi/clients/ssi_protocol.c > +++ b/drivers/hsi/clients/ssi_protocol.c > @@ -931,6 +931,7 @@ static int ssip_pn_open(struct net_device *dev) > if (err < 0) { > dev_err(&cl->device, "Register HSI port event failed (%d)\n", > err); > + hsi_release_port(cl); > return err; > } > dev_dbg(&cl->device, "Configuring SSI port\n"); Thanks, queued. -- Sebastian --evlazoyrppugj4l4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmMp4NQACgkQ2O7X88g7 +ponFRAAkqXj33I9pMg7pk8MlREeWZlbFSjx83m8YR7nLSgfFAMXt4qI01QJa5/k 3FbQwp9Gf13eCvauBbvzb9jXg2OukD/6GrCeVbUsxmbr8IQ9zuV3di2yzI5nCLiM 2cBaugH56SGD9PZHbrLH0Uxgh0fJEnB7ntjzfp8s1aPwscem4HZyYXxpnc+5HZGm DrthxjWd4RpA/TgjywnPHoom9Z6v/IGQVwe2CzJmz77lWSzeCbOWVUy3ccSHSyb/ rrdiYvlrlsxh1eJYoDN+FmzBjwIFI2vn60ECtSyBpXRmDXUm6gmt4Dr7Nl+cAUes IaBeSeJm5kqTFN39aD1xpPBqpEj+jDS2yLBye1HejPrdJrvKd9tucBmIKkGvFXoH seBMOW+hyzrXGWA4HUxCsfk+WIjNg6RbkEqv1Q4nFjVnsaZH6vBd2oscfM4JT3mU 0Wjtk31KDgoTb1WqNl2zotkuwoLbUP7n/2c2YL1iZNLz4s2RvqQ/DSJjHjB/wyZM aWBcQNyuSmEfklr6zrBfIkUZDQt1zUzIllk9ayFSsfxmtjS1AreeVyF4ttCn8Q9z TGic1A7H1lq5T991sadtB2A943MT428E6zQz6g4ddO5cQ6q9KsdpMyoYVM6UpXUH hfkmKFVEJpcJHUksYYssXkOVm3E4xFsDnDSoGxWfiNieIXlksDs= =QnIh -----END PGP SIGNATURE----- --evlazoyrppugj4l4--