Skip to content

Commit a765b9e

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two small and obvious driver fixes" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: elx: efct: Fix memory leak in efct_hw_parse_filter() scsi: target: Fix NULL pointer dereference in core_scsi3_decode_spec_i_port()
2 parents 11313e2 + 2a8a5a5 commit a765b9e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/scsi/elx/efct/efct_hw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ int
11201120
efct_hw_parse_filter(struct efct_hw *hw, void *value)
11211121
{
11221122
int rc = 0;
1123-
char *p = NULL;
1123+
char *p = NULL, *pp = NULL;
11241124
char *token;
11251125
u32 idx = 0;
11261126

@@ -1132,6 +1132,7 @@ efct_hw_parse_filter(struct efct_hw *hw, void *value)
11321132
efc_log_err(hw->os, "p is NULL\n");
11331133
return -ENOMEM;
11341134
}
1135+
pp = p;
11351136

11361137
idx = 0;
11371138
while ((token = strsep(&p, ",")) && *token) {
@@ -1144,7 +1145,7 @@ efct_hw_parse_filter(struct efct_hw *hw, void *value)
11441145
if (idx == ARRAY_SIZE(hw->config.filter_def))
11451146
break;
11461147
}
1147-
kfree(p);
1148+
kfree(pp);
11481149

11491150
return rc;
11501151
}

drivers/target/target_core_pr.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,9 @@ core_scsi3_decode_spec_i_port(
18421842
}
18431843

18441844
kmem_cache_free(t10_pr_reg_cache, dest_pr_reg);
1845-
core_scsi3_lunacl_undepend_item(dest_se_deve);
1845+
1846+
if (dest_se_deve)
1847+
core_scsi3_lunacl_undepend_item(dest_se_deve);
18461848

18471849
if (is_local)
18481850
continue;

0 commit comments

Comments
 (0)