All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parport_cs: Fix memory leak in parport_config
@ 2019-03-21  8:26 Yue Haibing
       [not found] ` <d59d35b9-7fb0-d1f0-b63c-4f7c2ff354e0@codeaurora.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Yue Haibing @ 2019-03-21  8:26 UTC (permalink / raw)
  To: sudipm.mukherjee, gregkh; +Cc: linux-kernel, YueHaibing

From: YueHaibing <yuehaibing@huawei.com>

parport_probe() alloc parport device 'info',
but while parport_config failed it does not free it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/parport/parport_cs.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
index e9b52e4..e77044c2 100644
--- a/drivers/parport/parport_cs.c
+++ b/drivers/parport/parport_cs.c
@@ -158,8 +158,9 @@ static int parport_config(struct pcmcia_device *link)
     return 0;
 
 failed:
-    parport_cs_release(link);
-    return -ENODEV;
+	parport_cs_release(link);
+	kfree(link->priv);
+	return -ENODEV;
 } /* parport_config */
 
 static void parport_cs_release(struct pcmcia_device *link)
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] parport_cs: Fix memory leak in parport_config
       [not found] ` <d59d35b9-7fb0-d1f0-b63c-4f7c2ff354e0@codeaurora.org>
@ 2019-03-27 16:34   ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-03-27 16:34 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: Yue Haibing, sudipm.mukherjee, linux-kernel

On Fri, Mar 22, 2019 at 05:39:17PM +0530, Mukesh Ojha wrote:
> 
> On 3/21/2019 1:56 PM, Yue Haibing wrote:
> > From: YueHaibing <yuehaibing@huawei.com>
> > 
> > parport_probe() alloc parport device 'info',
> > but while parport_config failed it does not free it.
> > 
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> > ---
> >   drivers/parport/parport_cs.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c
> > index e9b52e4..e77044c2 100644
> > --- a/drivers/parport/parport_cs.c
> > +++ b/drivers/parport/parport_cs.c
> > @@ -158,8 +158,9 @@ static int parport_config(struct pcmcia_device *link)
> >       return 0;
> >   failed:
> > -    parport_cs_release(link);
> > -    return -ENODEV;
> > +	parport_cs_release(link);
> > +	kfree(link->priv);
> > +	return -ENODEV;
> >   } /* parport_config */
> >   static void parport_cs_release(struct pcmcia_device *link)
> 
> 
> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org
> <mailto:mojha@codeaurora.org>>

Please do not send html email for kernel patches :(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-27 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21  8:26 [PATCH] parport_cs: Fix memory leak in parport_config Yue Haibing
     [not found] ` <d59d35b9-7fb0-d1f0-b63c-4f7c2ff354e0@codeaurora.org>
2019-03-27 16:34   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.