linux/drivers/block/zram
Sergey Senozhatsky fcfa8d95ca zram: return error-valued pointer from zcomp_create()
Instead of returning just NULL, return ERR_PTR from zcomp_create() if
compressing backend creation has failed.  ERR_PTR(-EINVAL) for unsupported
compression algorithm request, ERR_PTR(-ENOMEM) for allocation (zcomp or
compression stream) error.

Perform IS_ERR() check of returned from zcomp_create() value in
disksize_store() and set return code to PTR_ERR().

Change suggested by Jerome Marchand.

[akpm@linux-foundation.org: clean up error recovery flow]
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reported-by: Jerome Marchand <jmarchan@redhat.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-04-07 16:36:02 -07:00
..
Kconfig zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
Makefile zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp.c zram: return error-valued pointer from zcomp_create() 2014-04-07 16:36:02 -07:00
zcomp.h zram: make compression algorithm selection possible 2014-04-07 16:36:01 -07:00
zcomp_lz4.c zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lz4.h zram: add lz4 algorithm backend 2014-04-07 16:36:01 -07:00
zcomp_lzo.c zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zcomp_lzo.h zram: introduce compressing backend abstraction 2014-04-07 16:36:01 -07:00
zram_drv.c zram: return error-valued pointer from zcomp_create() 2014-04-07 16:36:02 -07:00
zram_drv.h zram: make compression algorithm selection possible 2014-04-07 16:36:01 -07:00