aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/st.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 3babdc76b3fb..e1a52c525ed4 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -1177,7 +1177,10 @@ static int st_open(struct inode *inode, struct file *filp)
1177 goto err_out; 1177 goto err_out;
1178 if ((filp->f_flags & O_NONBLOCK) == 0 && 1178 if ((filp->f_flags & O_NONBLOCK) == 0 &&
1179 retval != CHKRES_READY) { 1179 retval != CHKRES_READY) {
1180 retval = (-EIO); 1180 if (STp->ready == NO_TAPE)
1181 retval = (-ENOMEDIUM);
1182 else
1183 retval = (-EIO);
1181 goto err_out; 1184 goto err_out;
1182 } 1185 }
1183 return 0; 1186 return 0;