From 4ce549b875ca90dafae7f5fcea2927d32a4df4b7 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 27 Apr 2013 05:11:17 +0000 Subject: [PATCH] qla2x00t: Avoid dereferencing a NULL pointer git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4843 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qla2x00t/qla_init.c b/qla2x00t/qla_init.c index 43bc0f86e..b4b745fa8 100644 --- a/qla2x00t/qla_init.c +++ b/qla2x00t/qla_init.c @@ -4207,7 +4207,12 @@ int qla2xxx_tgt_register_driver(struct qla_tgt_data *tgt_data) ENTER(__func__); - if ((tgt_data == NULL) || (tgt_data->magic != QLA2X_TARGET_MAGIC)) { + if (tgt_data == NULL) { + printk(KERN_ERR "***ERROR*** Wrong version of the target mode " + "add-on: tgt_data == NULL\n"); + res = -EINVAL; + goto out; + } else if (tgt_data->magic != QLA2X_TARGET_MAGIC) { printk(KERN_ERR "***ERROR*** Wrong version of the target mode " "add-on: %d\n", tgt_data->magic); res = -EINVAL;