Skip to content
Commit 1b672224 authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman
Browse files

Staging: zram: Fix memory leak by refcount mismatch



As suggested by Minchan Kim and Jerome Marchand "The code in reset_store
get the block device (bdget_disk()) but it does not put it (bdput()) when
it's done using it. The usage count is therefore incremented but never
decremented."

This patch also puts bdput() for all error cases.

Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Acked-by: default avatarJerome Marchand <jmarchan@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9df68292
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment