[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f0ef28cb-7f4e-e346-7b88-aaf85ae0b5f5@kernel.dk>
Date: Sat, 29 Dec 2018 08:21:58 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Wenwen Wang <wang6495@....edu>
Cc: Maurizio Lombardi <mlombard@...hat.com>,
zhong jiang <zhongjiang@...wei.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gdrom: fix a memory leak bug
On 12/26/18 7:15 PM, Wenwen Wang wrote:
> In probe_gdrom(), the buffer pointed by 'gd.cd_info' is allocated through
> kzalloc() and is used to hold the information of the gdrom device. To
> register and unregister the device, the pointer 'gd.cd_info' is passed to
> the functions register_cdrom() and unregister_cdrom(), respectively.
> However, this buffer is not freed after it is used, which can cause a
> memory leak bug.
>
> This patch simply frees the buffer 'gd.cd_info' in exit_gdrom() to fix the
> above issue.
Applied, thanks.
--
Jens Axboe
Powered by blists - more mailing lists