Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2356026rdb; Mon, 20 Nov 2023 08:45:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeNLToMzrDgjWRtYWZQaGmzA5kwC7OffwgvqtexovoztOTPPyDyE/iscsVHy4UZ0FwBV76 X-Received: by 2002:a05:6a00:8c02:b0:6be:2901:2cd with SMTP id ih2-20020a056a008c0200b006be290102cdmr7268923pfb.10.1700498754189; Mon, 20 Nov 2023 08:45:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700498754; cv=none; d=google.com; s=arc-20160816; b=znDXDe4H26ENfA/7ikF/XrnQPfZ7d0BAd6mieRNTw7VGkXLBx6IwhnR4m0Phvzwm9x LHt07glhwFcaos+huBBbpuFivRoq6ptaSGcDrDXo3YrHKr7DNPYEN39h5z7EXUAaYRpA 7m6w68JaTalCyBTeqxwskWMJ0xjNSIaOYfjDFaUY6LfjWrFSTfelt+VYFr9Jbl6L+HtQ 678vYLwL/7miKKabtbLiFnKi6P8yBXsr6QfbP/kxIPuSQeqLuLKTy/eBJgrEVilywi9t 2QY1Yr5zvRxh1/iTvJst0A1VND7TYZwyIXKVQXxPtwwGQzTnMnW6W4Z96paUlx6CIj8S w8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=L4o3VOG4ILfrr1T6P8PAEWTvAp9sZLW5F5DWCMWcaJk=; fh=DXBCg43q+r/g1ygB6/PsNM0tg9mUZ9xvCbE+LicSfcQ=; b=N7LjTUpHaqtlVLupkLDfJ/WYzFhZsHWNRBFrqGMt4gbQGamiz6KY9JWe0G1oHiFTWh T7fQFiRFgClR4HH8HV/b2TEgVVkxIfXbUcfV6NwPgFZE0j88v+dFnHN5xoAph12fjQWb x1jp6uzrTlYAEp2g30hWZ4z8KjLpaDCRiOj77asHJIzQdcWNfxHrdW5PePddleKMFkf5 F+DnWVV/yz0DhE9ZpqsyVh20qYsrd/1VqXCerkHAE56Zr58pF1kLzudskH6vty8npCBT pRxucq42mNpQ1+B8pGbrmpcI8X/x/+n1nAeACgNpIWrjSJXW0AxrnEOxVpw7Z4Blizc3 OP3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rzLTLU2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id e10-20020a056a0000ca00b006c99b02c2ecsi8067763pfj.317.2023.11.20.08.45.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 08:45:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rzLTLU2l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CB80E80310C2; Mon, 20 Nov 2023 08:45:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234168AbjKTQox (ORCPT + 99 others); Mon, 20 Nov 2023 11:44:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233892AbjKTQof (ORCPT ); Mon, 20 Nov 2023 11:44:35 -0500 Received: from out-182.mta1.migadu.com (out-182.mta1.migadu.com [IPv6:2001:41d0:203:375::b6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F25AF1717 for ; Mon, 20 Nov 2023 08:43:58 -0800 (PST) Message-ID: <0c6e0cd5-d975-41cc-824e-10b5e28251a2@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1700498637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L4o3VOG4ILfrr1T6P8PAEWTvAp9sZLW5F5DWCMWcaJk=; b=rzLTLU2lqlffIevvY9geCyHiANnAhG5jcXbK47RH6QB7Um4NX0reB6N9SujkFNYlSOws4i TZaRQVi89F8PzHmyRY7ZfipNsf44iIvLisZVLVZQ2TtTY6yx0IDmTRPFv1FGBvGsk0SiGc Hf6w14c6ee9ihsCdof6TRfGV2LNZD4o= Date: Mon, 20 Nov 2023 16:43:50 +0000 MIME-Version: 1.0 Subject: Re: [PATCH] dpll: Fix potential msg memleak in dpll_nl_pin_id_get_doit Content-Language: en-US To: Hao Ge Cc: michal.michalik@intel.com, davem@davemloft.net, linux-kernel@vger.kernel.org, gehao618@163.com, arkadiusz.kubalewski@intel.com References: <20231120090758.31378-1-gehao@kylinos.cn> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: <20231120090758.31378-1-gehao@kylinos.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 08:45:38 -0800 (PST) On 20/11/2023 04:07, Hao Ge wrote: > We should clean the skb resource if genlmsg_put_reply failed. > > Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions") > Signed-off-by: Hao Ge > --- > drivers/dpll/dpll_netlink.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c > index a6dc3997bf5c..54051cd34d43 100644 > --- a/drivers/dpll/dpll_netlink.c > +++ b/drivers/dpll/dpll_netlink.c > @@ -1093,9 +1093,10 @@ int dpll_nl_pin_id_get_doit(struct sk_buff *skb, struct genl_info *info) > return -ENOMEM; > hdr = genlmsg_put_reply(msg, info, &dpll_nl_family, 0, > DPLL_CMD_PIN_ID_GET); > - if (!hdr) > + if (!hdr) { > + nlmsg_free(msg); > return -EMSGSIZE; > - > + } > pin = dpll_pin_find_from_nlattr(info); > if (!IS_ERR(pin)) { > ret = dpll_msg_add_pin_handle(msg, pin); The change seems reasonable, but we have 4 spots of the same problem in the file, could you please fix all of them in one patch? pw-bot: cr