[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151116155407.GK18797@mwanda>
Date: Mon, 16 Nov 2015 18:54:07 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: devel@...uxdriverproject.org,
Haiyang Zhang <haiyangz@...rosoft.com>,
Olaf Hering <olaf@...fle.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg()
failure
On Thu, Nov 12, 2015 at 12:32:13PM +0100, Vitaly Kuznetsov wrote:
> @@ -85,10 +86,10 @@ static ssize_t hvt_op_write(struct file *file, const char __user *buf,
> return PTR_ERR(inmsg);
>
> if (hvt->on_msg(inmsg, count))
> - return -EFAULT;
> + ret = -EFAULT;
You fix this leak and then re-introduce it again directly in patch 3/4.
Also it might be nice to preserve the error code.
ret = hvt->on_msg(inmsg, count);
kfree(inmsg);
return ret ? ret : count;
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists