mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Haverkamp <haver@linux.vnet.ibm.com>
To: Christian Engelmayer <cengelma@gmx.at>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, haver@linux.vnet.ibm.com
Subject: Re: [PATCH] misc: genwqe: Fix potential memory leak when pinning memory
Date: Mon, 27 Jan 2014 10:11:44 +0100	[thread overview]
Message-ID: <1390813904.18801.2.camel@oc7383187364.ibm.com> (raw)
In-Reply-To: <20140125224744.0a9c360c@spike>

Hi Christian,

Am Samstag, den 25.01.2014, 22:47 +0100 schrieb Christian Engelmayer:
> Fix a memory leak in the genwqe_pin_mem() error path as called by
> ioctl GENWQE_PIN_MEM. In case there is an error encountered when
> mapping memory, the already allocated dma_mapping struct needs to
> be freed correctly.
> 
> Detected by Coverity: CID 1162606.
> 
> Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
> ---
>  drivers/misc/genwqe/card_dev.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
> index 8f8a6b3..2c2c9cc 100644
> --- a/drivers/misc/genwqe/card_dev.c
> +++ b/drivers/misc/genwqe/card_dev.c
> @@ -787,6 +787,7 @@ static int genwqe_pin_mem(struct genwqe_file *cfile, struct genwqe_mem *m)
>  	if (rc != 0) {
>  		dev_err(&pci_dev->dev,
>  			"[%s] genwqe_user_vmap rc=%d\n", __func__, rc);
> +		kfree(dma_map);
>  		return rc;
>  	}
> 

thanks for discovering and fixing the problem.

Acked-by: Frank Haverkamp <haver@linux.vnet.ibm.com>


      reply	other threads:[~2014-01-27  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-25 21:47 Christian Engelmayer
2014-01-27  9:11 ` Frank Haverkamp [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=1390813904.18801.2.camel@oc7383187364.ibm.com \
    --to=haver@linux.vnet.ibm.com \
    --cc=cengelma@gmx.at \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®