From: Mike Christie Date: Wed, 30 May 2007 17:57:07 +0000 (-0500) Subject: [SCSI] iscsi_transport: Check iscsi interface skb allocation return value X-Git-Tag: MMI-PSA29.97-13-9~42242^2~93 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=239a7dc2fea4d079bc3090b5514497a5ced400d3;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [SCSI] iscsi_transport: Check iscsi interface skb allocation return value Let's not oops when we cannot allocate a skb! Add a check for if alloc_skb fails. Signed-off-by: Mike Christie Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index caf1836bbeca..4fbd8e1a0695 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -609,12 +609,10 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi, int t = done ? NLMSG_DONE : type; skb = alloc_skb(len, GFP_ATOMIC); - /* - * FIXME: - * user is supposed to react on iferror == -ENOMEM; - * see iscsi_if_rx(). - */ - BUG_ON(!skb); + if (!skb) { + printk(KERN_ERR "Could not allocate skb to send reply.\n"); + return -ENOMEM; + } nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0); nlh->nlmsg_flags = flags;