zsmalloc: fix zs_init cpu notifier error handling
authorSergey Senozhatsky <[email protected]>
Sat, 13 Dec 2014 00:56:56 +0000 (16:56 -0800)
committerLinus Torvalds <[email protected]>
Sat, 13 Dec 2014 20:42:50 +0000 (12:42 -0800)
commitb1b00a5b8a6cf32e3973507decf1216709b55072
tree768a19295b08df9423ebae482949f3dbe35a4c23
parent8c7f01025f7becd577bed9af93f974fc6798c5a3
zsmalloc: fix zs_init cpu notifier error handling

Mahendran Ganesh reported that zpool-enabled zsmalloc should not call
zpool_unregister_driver() from zs_init() if cpu notifier registration has
failed, because error handling is performed before we register the driver
via zpool_register_driver() call.

Factor out cpu notifier registration and unregistration code and fix
zs_init() error handling.

link: http://lkml.iu.edu//hypermail/linux/kernel/1411.1/04156.html
[[email protected]: squash bogus gcc warning]
[[email protected]: use __init and __exit]
Signed-off-by: Sergey Senozhatsky <[email protected]>
Reported-by: Mahendran Ganesh <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Nitin Gupta <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
mm/zsmalloc.c