qla2x00t: Avoid dereferencing a NULL pointer

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4843 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-04-27 05:11:17 +00:00
parent 28a66d7a0d
commit 4ce549b875

View File

@@ -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;