]> git.karo-electronics.de Git - mv-sheeva.git/commit
Staging: ramzswap: Handle case for invalid backing swap
authorNitin Gupta <ngupta@vflare.org>
Thu, 28 Jan 2010 15:49:59 +0000 (21:19 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:53 +0000 (16:42 -0800)
commitc25d75a234df36446dc0d9bb3365ab8b83374d50
treea7fe3c20e9b8eb8837e952ffc0306017514ec004
parent2e882281742f7e483e751bbbaf6c0946b5f8513f
Staging: ramzswap: Handle case for invalid backing swap

Currently, we crash (issue BUG_ON) if backing swap
disk size is zero. This can happen is user specified
an extended partition or simply a bad disk as backing
swap. A crash is really an unpleasant surprise to user
for such trivial problems.

Now, we check for this condition and simply fail device
initialization if this is the case.

Additional cleanups:
 * use static for all functions
 * remove extra newline between functions
 * memset backing_swap_name to NULL on device reset

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/ramzswap/ramzswap_drv.c