mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Fix crash on TP check, if file name is NULL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3603 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -609,14 +609,14 @@ out:
|
||||
|
||||
static void vdisk_check_tp_support(struct scst_vdisk_dev *virt_dev)
|
||||
{
|
||||
struct inode *inode;
|
||||
struct file *fd;
|
||||
struct inode *inode = NULL;
|
||||
struct file *fd = NULL;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
virt_dev->dev_thin_provisioned = 0;
|
||||
|
||||
if (virt_dev->rd_only)
|
||||
if (virt_dev->rd_only || (virt_dev->filename == NULL))
|
||||
goto out_check;
|
||||
|
||||
fd = filp_open(virt_dev->filename, O_LARGEFILE, 0600);
|
||||
@@ -648,7 +648,8 @@ static void vdisk_check_tp_support(struct scst_vdisk_dev *virt_dev)
|
||||
}
|
||||
|
||||
out_close:
|
||||
filp_close(fd, NULL);
|
||||
if (fd != NULL)
|
||||
filp_close(fd, NULL);
|
||||
|
||||
out_check:
|
||||
if (virt_dev->thin_provisioned_manually_set) {
|
||||
|
||||
Reference in New Issue
Block a user