summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libsrp.c')
-rw-r--r--drivers/scsi/libsrp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c
index 8424b8606efb..ab19b3b4be52 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)
{
struct iu_entry *iue = NULL;
- kfifo_out_locked(&target->iu_queue.queue, (void *) &iue,
- sizeof(void *), &target->iu_queue.lock);
+ if (kfifo_out_locked(&target->iu_queue.queue, (void *) &iue,
+ sizeof(void *), &target->iu_queue.lock) != sizeof(void *)) {
+ WARN_ONCE(1, "unexpected fifo state");
+ return NULL;
+ }
if (!iue)
return iue;
iue->target = target;