From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 1C2E01C15DD for ; Thu, 19 Nov 2015 09:43:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 178FC8BF30 for ; Thu, 19 Nov 2015 09:43:09 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BVvXjYrYc9W4 for ; Thu, 19 Nov 2015 09:43:08 +0000 (UTC) Received: from email.microchip.com (exsmtp01.microchip.com [198.175.253.37]) by whitealder.osuosl.org (Postfix) with ESMTPS id 134FC8BF2D for ; Thu, 19 Nov 2015 09:43:08 +0000 (UTC) Date: Thu, 19 Nov 2015 10:42:33 +0100 From: Christian Gromm Subject: Re: [PATCH 06/28] staging: most: fix mbo leak Message-ID: <20151119104233.2a7b6b1c@muaddib> In-Reply-To: <20151119051124.GA4079@sudip-pc> References: <1447850632-16782-1-git-send-email-christian.gromm@microchip.com> <1447850632-16782-7-git-send-email-christian.gromm@microchip.com> <20151119051124.GA4079@sudip-pc> MIME-Version: 1.0 List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Sudip Mukherjee Cc: gregkh@linuxfoundation.org, driverdev-devel@linuxdriverproject.org On Thu, 19 Nov 2015 10:41:24 +0530 Sudip Mukherjee wrote: > On Wed, Nov 18, 2015 at 01:43:30PM +0100, Christian Gromm wrote: > > This patch fixes a potential MBO leak in case function aim_read() > > exits right after the MBO has been fetched from kfifo and before > > it has been saved to the variable stacked_mbo. > > > > Signed-off-by: Christian Gromm > > --- > > drivers/staging/most/aim-cdev/cdev.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c > > index 6ee4eb2..86194ce 100644 > > --- a/drivers/staging/most/aim-cdev/cdev.c > > +++ b/drivers/staging/most/aim-cdev/cdev.c > > @@ -237,6 +237,7 @@ aim_read(struct file *filp, char __user *buf, size_t count, loff_t *offset) > > (!channel->dev)))) > > return -ERESTARTSYS; > > } > > + channel->stacked_mbo = mbo; > > You can also come out of the while loop when channel->dev is NULL. > > Maybe this should have been: > if (channel->dev) > channel->stacked_mbo = mbo; You're probably right. But the stacked_mbo pointer is going to be removed with patch 25 of this patchset anyway. This patch is just a part to get the whole story across. Thanks, Chris > > regards > sudip _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel