[stgt] [PATCH] Passing NULL to ldd_init() instead of illegal address
Roi Dayan
roid at mellanox.com
Thu May 31 08:48:42 CEST 2012
Hi Tomo,
The description is wrong here in the commit.
The illegal address is passed when there are no non-options arguments.
Sorry for that.
I'll submit it again with fixed description.
Thanks,
Roi
-----Original Message-----
From: Roi Dayan [mailto:roid at mellanox.com]
Sent: Thursday, May 31, 2012 9:44 AM
To: fujita.tomonori at lab.ntt.co.jp
Cc: stgt at vger.kernel.org; Roi Dayan
Subject: [PATCH] Passing NULL to ldd_init() instead of illegal address
ldd_init() was passed illegal address in case there were non-option arguments
Signed-off-by: Roi Dayan <roid at mellanox.com>
---
Hi Tomo,
This patch fix the case where there were no non-option arguments and then
lld_init() was passed an illegal address.
I noticed that all non-option arguments are passed to each lld but not in use.
Maybe its something that can be removed?
Thanks,
Roi
usr/tgtd.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/usr/tgtd.c b/usr/tgtd.c
index 4ec6f23..cba2b66 100644
--- a/usr/tgtd.c
+++ b/usr/tgtd.c
@@ -487,6 +487,7 @@ int main(int argc, char **argv) {
struct sigaction sa_old;
struct sigaction sa_new;
+ char *spare_args;
int err, ch, longindex, nr_lld = 0;
int is_daemon = 1, is_debug = 0;
int ret;
@@ -549,7 +550,9 @@ int main(int argc, char **argv)
exit(1);
}
- nr_lld = lld_init(argv[optind]);
+ spare_args = optind < argc ? argv[optind] : NULL;
+
+ nr_lld = lld_init(spare_args);
if (!nr_lld) {
fprintf(stderr, "No available low level driver!\n");
exit(1);
--
1.7.8.2
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list