From: Mirko Lindner <demon@pro-linux.de>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: marcelo@conectiva.com.br, linux-kernel@vger.kernel.org,
mlindner@syskonnect.de
Subject: Re: [PATCH] [2.4] Fix memleak on error exit path in sk98 driver.
Date: Sun, 21 Sep 2003 14:14:40 +0000 [thread overview]
Message-ID: <3F6DB250.6000207@pro-linux.de> (raw)
In-Reply-To: 20030921114529.GA31747@linuxhacker.ru
Thank you. Will be done tomorrow.
Cheers,
Mirko
Oleg Drokin schrieb:
> Hello!
>
> There is a trivial memleak in sk98 ioctl handling routinue,
> the patch is also trivial. Please apply.
> Found with help of smatch.
>
> ===== drivers/net/sk98lin/skge.c 1.14 vs edited =====
> --- 1.14/drivers/net/sk98lin/skge.c Wed Sep 3 21:15:10 2003
> +++ edited/drivers/net/sk98lin/skge.c Sun Sep 21 15:38:01 2003
> @@ -3616,20 +3616,21 @@
> Length = sizeof(pAC->PnmiStruct) + HeaderLength;
> }
> if (NULL == (pMemBuf = kmalloc(Length, GFP_KERNEL))) {
> - return -EFAULT;
> + return -ENOMEM;
> }
> if(copy_from_user(pMemBuf, Ioctl.pData, Length)) {
> - return -EFAULT;
> + goto fault;
> }
> if ((Ret = SkPnmiGenIoctl(pAC, pAC->IoBase, pMemBuf, &Length, 0)) < 0) {
> - return -EFAULT;
> + goto fault;
> }
> if(copy_to_user(Ioctl.pData, pMemBuf, Length) ) {
> - return -EFAULT;
> + goto fault;
> }
> Ioctl.Len = Length;
> if(copy_to_user(rq->ifr_data, &Ioctl, sizeof(SK_GE_IOCTL))) {
> - return -EFAULT;
> +fault:
> + Err = -EFAULT;
> }
> kfree(pMemBuf); /* cleanup everything */
> break;
>
>
> <!DSPAM:3f6d8f69246641288117544>
>
prev parent reply other threads:[~2003-09-21 12:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-21 11:45 [PATCH] [2.4] Fix memleak on error exit path in sk98 driver Oleg Drokin
2003-09-21 14:14 ` Mirko Lindner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F6DB250.6000207@pro-linux.de \
--to=demon@pro-linux.de \
--cc=green@linuxhacker.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=mlindner@syskonnect.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox