zram: destroy all devices on error recovery path in zram_init()
authorJiang Liu <liuj97@gmail.com>
Thu, 6 Jun 2013 16:07:24 +0000 (00:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2013 19:12:20 +0000 (12:12 -0700)
commit39a9b8ac9333e4268ecff7da6c9d1ab3823ff243
treee202fca393aa082b767f9c1235c4c60d6a2d8120
parent57ab048532c0d975538cebd4456491b5c34248f4
zram: destroy all devices on error recovery path in zram_init()

On error recovery path of zram_init(), it leaks the zram device object
causing the failure. So change create_device() to free allocated
resources on error path.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/zram/zram_drv.c