[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5C-Hv=oE4gb32OssGhH-5S4mwOLnwL1HEjCEZ82akSeRg@mail.gmail.com>
Date: Wed, 6 May 2015 19:32:42 -0300
From: Fabio Estevam <festevam@...il.com>
To: Alexey Khoroshilov <khoroshilov@...ras.ru>
Cc: Jonathan Cameron <jic23@...nel.org>,
Hartmut Knaack <knaack.h@....de>,
Lars-Peter Clausen <lars@...afoo.de>,
Peter Meerwald <pmeerw@...erw.net>, linux-iio@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
ldv-project@...uxtesting.org
Subject: Re: [PATCH] iio: hid-sensors: Fix memory leak on failure path in hid_prox_probe()
On Wed, May 6, 2015 at 7:14 PM, Alexey Khoroshilov
<khoroshilov@...ras.ru> wrote:
> Not exactly. Other calls are after
> indio_dev->channels = channels;
> So,
> error_free_dev_mem:
> kfree(indio_dev->channels);
> works for them well.
indio_dev is allocated using devm_ , so you don't need to free it.
Your patch is not correct because you only kfree(channels) in the
prox_parse_report() error case, but you missed the other subsequent
functions.
--
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