diff options
author | James Bottomley <James.Bottomley@HansenPartnership.com> | 2015-12-03 09:32:33 -0800 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2015-12-03 09:32:33 -0800 |
commit | be9e2f775f5a3147205c552534c3abf0f9374a13 (patch) | |
tree | 9c10584796d73f80295d9c238a089f12621db316 /drivers/scsi/st.c | |
parent | e619e6cbecb7fe97a924d625e848605333457b13 (diff) | |
parent | 3ddda3e4c82dea58933bde8d0f6ef34470c360cb (diff) |
Merge branch 'mkp-fixes' into fixes
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index e0a1e52a04e7..2e522951b619 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -4083,6 +4083,7 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew) } cdev->owner = THIS_MODULE; cdev->ops = &st_fops; + STm->cdevs[rew] = cdev; error = cdev_add(cdev, cdev_devno, 1); if (error) { @@ -4091,7 +4092,6 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew) pr_err("st%d: Device not attached.\n", dev_num); goto out_free; } - STm->cdevs[rew] = cdev; i = mode << (4 - ST_NBR_MODE_BITS); snprintf(name, 10, "%s%s%s", rew ? "n" : "", @@ -4110,8 +4110,9 @@ static int create_one_cdev(struct scsi_tape *tape, int mode, int rew) return 0; out_free: cdev_del(STm->cdevs[rew]); - STm->cdevs[rew] = NULL; out: + STm->cdevs[rew] = NULL; + STm->devs[rew] = NULL; return error; } |