mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
mtd: tests: don't use mtd0 as a default
mtd tests may erase the mtd device, so force the user to specify which mtd device to test by using the module parameter. Disable the default (using mtd0) since this may destroy a vital part of the flash if the module is inserted accidently or carelessly. Reported-by: Roland Kletzing <devzero@web.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
This commit is contained in:
committed by
Artem Bityutskiy
parent
6be55f79a2
commit
7406060e29
@@ -29,7 +29,7 @@
|
||||
|
||||
#define PRINT_PREF KERN_INFO "mtd_readtest: "
|
||||
|
||||
static int dev;
|
||||
static int dev = -EINVAL;
|
||||
module_param(dev, int, S_IRUGO);
|
||||
MODULE_PARM_DESC(dev, "MTD device number to use");
|
||||
|
||||
@@ -170,6 +170,12 @@ static int __init mtd_readtest_init(void)
|
||||
|
||||
printk(KERN_INFO "\n");
|
||||
printk(KERN_INFO "=================================================\n");
|
||||
|
||||
if (dev < 0) {
|
||||
printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
printk(PRINT_PREF "MTD device: %d\n", dev);
|
||||
|
||||
mtd = get_mtd_device(NULL, dev);
|
||||
|
||||
Reference in New Issue
Block a user