Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1461684 > unrolled thread
| Started by | Abylay Ospan <aospan@netup.ru> |
|---|---|
| First post | 2016-08-14 10:30 +0200 |
| Last post | 2016-08-14 10:30 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] helene: fix memory leak when heleno_x_pon fails Abylay Ospan <aospan@netup.ru> - 2016-08-14 10:30 +0200
| From | Abylay Ospan <aospan@netup.ru> |
|---|---|
| Date | 2016-08-14 10:30 +0200 |
| Subject | Re: [PATCH] helene: fix memory leak when heleno_x_pon fails |
| Message-ID | <s5YXT-5oj-3@gated-at.bofh.it> |
Hi Colin,
It's really possible memory leak here. thanks for fix.
Acked-by: Abylay Ospan <aospan@netup.ru>
2016-08-13 14:16 GMT-04:00 Colin King <colin.king@canonical.com>:
> From: Colin Ian King <colin.king@canonical.com>
>
> The error return path of failed calls to heleno_x_pon leak
> memory because priv is not kfree'd. Fix this by kfree'ing
> priv before returning.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/media/dvb-frontends/helene.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/helene.c b/drivers/media/dvb-frontends/helene.c
> index 97a8982..3d1cd5f 100644
> --- a/drivers/media/dvb-frontends/helene.c
> +++ b/drivers/media/dvb-frontends/helene.c
> @@ -987,8 +987,10 @@ struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe,
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 1);
>
> - if (helene_x_pon(priv) != 0)
> + if (helene_x_pon(priv) != 0) {
> + kfree(priv);
> return NULL;
> + }
>
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 0);
> @@ -1021,8 +1023,10 @@ struct dvb_frontend *helene_attach(struct dvb_frontend *fe,
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 1);
>
> - if (helene_x_pon(priv) != 0)
> + if (helene_x_pon(priv) != 0) {
> + kfree(priv);
> return NULL;
> + }
>
> if (fe->ops.i2c_gate_ctrl)
> fe->ops.i2c_gate_ctrl(fe, 0);
> --
> 2.8.1
>
--
Abylay Ospan,
NetUP Inc.
http://www.netup.tv
Back to top | Article view | linux.kernel
csiph-web