Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3617879pxk; Tue, 29 Sep 2020 01:29:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXZyeGQNj/RJrw6EF8IrI2Frea6VoYK951UvBNx0ihvT03AC6Vbyl2JZO03j4ehDQvOK1u X-Received: by 2002:a17:907:2456:: with SMTP id yw22mr2598785ejb.337.1601368157453; Tue, 29 Sep 2020 01:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601368157; cv=none; d=google.com; s=arc-20160816; b=FqHN5WquyjrFYgLo5+dtjQaXCwMLEuKbs3DJMAa5Q4rbwm2Gwc7d2WNsPYLXoiZ7Ma pNcbABBIHWKEz3PzjMGDOZKduYhHPrfeyO3Cg7vcL16TwMEvXykCSQrk3wLgjW3y02i9 Yvvh2eE3KE62aA3CQ2L9nUKMAVAhH/2LVw8iy+nwDMvSJMGUHlIzHM6xlV0IZgvga8Eb pyhsmSSwKDrnX9maBpdr6I8OInqGBGXoGdr3axH0csMC9/yOr2mz3aO0O+8PEVXZouRk q1SZ6g5VPQt+yRJIMY2bmQ7CemBsblK8AqH1YTKocSevkFdRS2FRvzkzB8tQHdRz7pz8 k41g== 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 :message-id:date:subject:cc:to:from; bh=3LIivWDexyuz+mpoaaGzjNzQvrVh1LI/GzhT9JyPTaM=; b=xMYGm4WfvQWuzu/KSERzPEYCLIUEfrIhBC9/u3is4c3h+UsUdyRI4NtwqqklF3zZKy 4oMTvAIlTP3C9aCx0e409OQ7vtU7FXy2DasxViq5d+rls1PEMjkH29dPjgBHiONPinLw IpVFgzeQlUvwtmT6soLaq0QRwtXqbYP5VxyTASKh+Nhd4FfH4hlu0KO3eCQNT0xQ4lUG oewM2ZcDdBbgkYtOqxh28i0Lk/84ORhfPHFoUXCEqLZ6C/N32SNOWWL3uTA9134teItq 6bbxZSTo6K9P+/60dPGPnxpwGnwk+9pNnlmdn2CFAy/LkmpaJ9sYVN74pruVuqmq3A2t xJfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si2333152edv.452.2020.09.29.01.28.54; Tue, 29 Sep 2020 01:29:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727438AbgI2I1n (ORCPT + 99 others); Tue, 29 Sep 2020 04:27:43 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40054 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725550AbgI2I1n (ORCPT ); Tue, 29 Sep 2020 04:27:43 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6773D63A7B6C47B20E41; Tue, 29 Sep 2020 16:27:16 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 29 Sep 2020 16:27:05 +0800 From: Jing Xiangfeng To: , , CC: , , Subject: [PATCH] thermal: core: add the misse nlmsg_free() for thermal_genl_sampling_temp() Date: Tue, 29 Sep 2020 16:26:52 +0800 Message-ID: <20200929082652.59876-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org thermal_genl_sampling_temp() misses to call nlmsg_free() in an error path. Jump to out_free to fix it. Signed-off-by: Jing Xiangfeng --- drivers/thermal/thermal_netlink.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_netlink.c b/drivers/thermal/thermal_netlink.c index af7b2383e8f6..019f4812def6 100644 --- a/drivers/thermal/thermal_netlink.c +++ b/drivers/thermal/thermal_netlink.c @@ -78,7 +78,7 @@ int thermal_genl_sampling_temp(int id, int temp) hdr = genlmsg_put(skb, 0, 0, &thermal_gnl_family, 0, THERMAL_GENL_SAMPLING_TEMP); if (!hdr) - return -EMSGSIZE; + goto out_free; if (nla_put_u32(skb, THERMAL_GENL_ATTR_TZ_ID, id)) goto out_cancel; @@ -93,6 +93,7 @@ int thermal_genl_sampling_temp(int id, int temp) return 0; out_cancel: genlmsg_cancel(skb, hdr); +out_free: nlmsg_free(skb); return -EMSGSIZE; -- 2.26.0.106.g9fadedd