Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1706658imu; Thu, 17 Jan 2019 01:49:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN7cOFR/iVvCuMeSjPdhtA0Mf513btI2ED/ViWUir/qprCKTOH1ZnHL3cN7kMqMiMRR5fJ0R X-Received: by 2002:a17:902:724a:: with SMTP id c10mr14485203pll.51.1547718539959; Thu, 17 Jan 2019 01:48:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547718539; cv=none; d=google.com; s=arc-20160816; b=X+oT9vk7X9wi9wmhd7ZNWqIH97YrPhJLPZ8SFtwsVqkOGGjnsIqI/40u2CaIuutrBG t8bMz/GpmqeLrSX5Q8tS82sfUOBspssCbihNOAivwvLzGqtglPVLKcCgdm7dKQ4NMfSL Shu+i6sZDCe5Phn8N3C8CfuW/30BPUw7H4XnkXfNQEEXgQhs9J5T+KOgxJ2hjxIywjBI fbd3QanfdWd5hdaJ5PRVcMno73yj4NELA26tklZUY/xOOuRrovcbhhKgSavTxDlZeK/Z eb5ajW2F/Ir2Y2CqqvgO+gGdMW+AfbN8wuyy/s4lHOld1mCUwLAz5afqy3JsE0d47AQ2 ZQmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=u2yxwp4qRm65wWPX7dQXVEqb62VuzrBVypk38LOuasY=; b=ucnS1QpOcY9GUtlIWiEQHuuU7qS1EKykHNLRgwc5P02y5iy8ZYffthKvcpb7kHMSqC WCSe+ZQH/SJFnGaeYilJ2tvSA0naR9/D/mhutwmDtdG7ts0wRejhp1WZiAgx9QPZAGNz blaQ0lM8FS//LhaLyIFDomN0zwA5Hp7ki74yMTorcNDxOGqPRQ2M8B0XDfkPaDI/mu1J iGTNT+NGSyXBdkVqnBg4yYGQ4Mobex2Qd3oSSJau9iCawxql1NQJ4vJn89ZknZUGRPRk mOWF+9nCtjjhSGoR+Q9H0TaQRnFBi/xjzTH02Nh5Cl3+4glu6Ai5DLxSCNmXS5Yct8I2 6hZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38si1277043pla.207.2019.01.17.01.48.44; Thu, 17 Jan 2019 01:48:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728142AbfAQJ2T (ORCPT + 99 others); Thu, 17 Jan 2019 04:28:19 -0500 Received: from mout.gmx.net ([212.227.15.19]:46025 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726326AbfAQJ2S (ORCPT ); Thu, 17 Jan 2019 04:28:18 -0500 Received: from localhost.localdomain ([218.18.229.179]) by mail.gmx.com (mrgmx003 [212.227.17.184]) with ESMTPSA (Nemesis) id 0LztHH-1hFnxT2Fmd-0152af; Thu, 17 Jan 2019 10:28:17 +0100 From: Chengguang Xu To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Chengguang Xu Subject: [PATCH] uio: fix potential memory leak in error case Date: Thu, 17 Jan 2019 17:27:46 +0800 Message-Id: <20190117092746.17500-1-cgxu519@gmx.com> X-Mailer: git-send-email 2.17.2 X-Provags-ID: V03:K1:bLr+NofRoXat+M0ErJcpcBvvooMYSbwif0o235QX67rtTJ+apKi 7rzkcoGFfzqWa5CDYBF57FXJSs+Xv9253PrUpTaSDw5z0EBS0PIOU4QTsQuscfOYYKaWw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ZmXVhPFvf18geVDRVaoJPv++PyviAjpmALgbLgGvLRzMc45JwURHAbUpxAT3pgswN 4M9sTHS6ytA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Should jump to lable err_infoopen when idev->info is NULL in uio_open(). Signed-off-by: Chengguang Xu --- drivers/uio/uio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 131342280b46..46e5c1c31ebe 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c @@ -491,7 +491,7 @@ static int uio_open(struct inode *inode, struct file *filep) if (!idev->info) { mutex_unlock(&idev->info_lock); ret = -EINVAL; - goto err_alloc_listener; + goto err_infoopen; } if (idev->info && idev->info->open) -- 2.17.2