Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1270307
| From | Dan Carpenter <dan.carpenter@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure |
| Date | 2015-11-16 17:00 +0100 |
| Message-ID | <qvumf-M6-33@gated-at.bofh.it> (permalink) |
| References | <qtYop-8hK-5@gated-at.bofh.it> <qtYoq-8hK-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-11-12 12:40 +0100
Re: [PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure Dan Carpenter <dan.carpenter@oracle.com> - 2015-11-16 17:00 +0100
Re: [PATCH 1/4] Drivers: hv: utils: fix memory leak on on_msg() failure Vitaly Kuznetsov <vkuznets@redhat.com> - 2015-11-16 18:50 +0100
csiph-web