Skip to content

Commit c7e9075

Browse files
author
Al Viro
committed
ocxlflash_getfile(): fix double-iput() on alloc_file() failures
Cc: [email protected] Acked-by: Linus Torvalds <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent d202797 commit c7e9075

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/scsi/cxlflash/ocxl_hw.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,14 @@ static struct file *ocxlflash_getfile(struct device *dev, const char *name,
134134
rc = PTR_ERR(file);
135135
dev_err(dev, "%s: alloc_file failed rc=%d\n",
136136
__func__, rc);
137-
goto err5;
137+
path_put(&path);
138+
goto err3;
138139
}
139140

140141
file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
141142
file->private_data = priv;
142143
out:
143144
return file;
144-
err5:
145-
path_put(&path);
146145
err4:
147146
iput(inode);
148147
err3:

0 commit comments

Comments
 (0)