[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23ffd3c5-0095-6a95-8c30-2b6f67377ce7@axentia.se>
Date: Thu, 22 Apr 2021 23:29:22 +0200
From: Peter Rosin <peda@...ntia.se>
To: gregkh@...uxfoundation.org
Cc: axboe@...nel.dk, linux-kernel@...r.kernel.org, wang6495@....edu
Subject: Re: [PATCH 167/190] Revert "gdrom: fix a memory leak bug"
> This reverts commit 093c48213ee37c3c3ff1cf5ac1aa2a9d8bc66017.
The reverted patch looks fishy.
gc.cd_info is kzalloc:ed on probe. In case probe fails after this allocation, the
memory is kfree:d but the variable is NOT zeroed out.
AFAICT, the above leads to a double-free on exit by the added line.
I believe gd.cd_info should be kfree:d on remove instead.
However, might not gc.toc also be kfree:d twice for similar reasons?
I could easily be mistaken.
Cheers,
Peter
Powered by blists - more mailing lists