Re: [PATCH][resend] fix resource leak in pnp card_probe()

From: Jesper Juhl
Date: Sun May 14 2006 - 07:01:32 EST


On 14/05/06, Andrew Morton <akpm@xxxxxxxx> wrote:
Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote:
>
> (resend of patch already send once on 23/03-2006
> - still applies cleanly to latest -git)
>
>
> We can leak `clink' in drivers/pnp/card.c::card_probe()
>
[snip]

If !drv->probe then there's not much point in doing the kmalloc and then
immediately freeing it again.

True. It was simply the simplest and least intrusive fix I could make.

Like this?

Looks good to me, thanks.

[snip neater version of fix]


--
Jesper Juhl <jesper.juhl@xxxxxxxxx>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/