[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1112261804000.1873@localhost6.localdomain6>
Date: Mon, 26 Dec 2011 18:10:32 +0100 (CET)
From: Julia Lawall <julia.lawall@...6.fr>
To: grant.likely@...retlab.ca, linus.walleij@...ricsson.com
cc: linux-kernel@...r.kernel.org
Subject: question about bgpio_remove (drivers/gpio/gpio-generic.c)
The function bgpio_remove in the file drivers/gpio/gpio-generic.c is
defind as follows:
int bgpio_remove(struct bgpio_chip *bgc)
{
int err = gpiochip_remove(&bgc->gc);
kfree(bgc);
return err;
}
EXPORT_SYMBOL_GPL(bgpio_remove);
But bgc is allocated using devm_kzalloc, not kzalloc, and thus the kfree
would seem to result in a dangling pointer. On the other hand, this
function does not have access to the information required to call
devm_kfree (&pdev->dev). Since the function is exported, should the
interface be maintained, and the allocation of bgc converted to use
kzalloc? Or should the interface be changed to add the required
information. The callers in the kernel have the require information
available.
thanks,
julia
--
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