diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/libiscsi_tcp.c | 9 | ||||
-rw-r--r-- | drivers/scsi/libsrp.c | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c index d51ffeca2ec..db6856c138f 100644 --- a/drivers/scsi/libiscsi_tcp.c +++ b/drivers/scsi/libiscsi_tcp.c | |||
@@ -990,8 +990,13 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task) | |||
990 | } | 990 | } |
991 | 991 | ||
992 | if (r2t == NULL) { | 992 | if (r2t == NULL) { |
993 | kfifo_out(&tcp_task->r2tqueue, | 993 | if (kfifo_out(&tcp_task->r2tqueue, |
994 | (void *)&tcp_task->r2t, sizeof(void *)); | 994 | (void *)&tcp_task->r2t, sizeof(void *)) != |
995 | sizeof(void *)) { | ||
996 | WARN_ONCE(1, "unexpected fifo state"); | ||
997 | r2t = NULL; | ||
998 | } | ||
999 | |||
995 | r2t = tcp_task->r2t; | 1000 | r2t = tcp_task->r2t; |
996 | } | 1001 | } |
997 | spin_unlock_bh(&session->lock); | 1002 | spin_unlock_bh(&session->lock); |
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c index 8424b8606ef..ab19b3b4be5 100644 --- a/drivers/scsi/libsrp.c +++ b/drivers/scsi/libsrp.c | |||
@@ -163,8 +163,11 @@ struct iu_entry *srp_iu_get(struct srp_target *target) | |||
163 | { | 163 | { |
164 | struct iu_entry *iue = NULL; | 164 | struct iu_entry *iue = NULL; |
165 | 165 | ||
166 | kfifo_out_locked(&target->iu_queue.queue, (void *) &iue, | 166 | if (kfifo_out_locked(&target->iu_queue.queue, (void *) &iue, |
167 | sizeof(void *), &target->iu_queue.lock); | 167 | sizeof(void *), &target->iu_queue.lock) != sizeof(void *)) { |
168 | WARN_ONCE(1, "unexpected fifo state"); | ||
169 | return NULL; | ||
170 | } | ||
168 | if (!iue) | 171 | if (!iue) |
169 | return iue; | 172 | return iue; |
170 | iue->target = target; | 173 | iue->target = target; |