From 4cd021ae8620717240c46a7e7888f952f7ce3127 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 31 Jan 2014 02:33:11 +0000 Subject: [PATCH] scst_vdisk: Check that "filename" is specified at most once Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5255 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index d6bd45ebf..30834d194 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4710,6 +4710,12 @@ static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev, } if (!strcasecmp("filename", p)) { + if (virt_dev->filename) { + PRINT_ERROR("%s specified more than once" + " (device %s)", p, virt_dev->name); + res = -EINVAL; + goto out; + } if (*pp != '/') { PRINT_ERROR("Filename %s must be global " "(device %s)", pp, virt_dev->name);