This fixes the memory found when running coccinelle on the latest kernel tree for if we are unable to successfully allocate memory for the structure pointer,sinfo of type skt_dev_info and need to clean up the memory already allocated to the clk structure pointer, clk by calling clk_get on it and freeing the no longer required mermory for this structure pointer.
Signed-off-by: Nicholas Krause <[email protected]> --- drivers/pcmcia/sa11xx_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index cf6de2c..457618b 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -229,8 +229,10 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, sa11xx_drv_pcmcia_ops(ops); sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); - if (!sinfo) + if (!sinfo) { + clk_get(dev); return -ENOMEM; + } sinfo->nskt = nr; sinfo->clk = clk; -- 2.1.0 _______________________________________________ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
