Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=239a7dc2fea4d079bc3090b5514497a5ced400d3
Commit:     239a7dc2fea4d079bc3090b5514497a5ced400d3
Parent:     5c9cfeddbb49954b459fda91bf5479f5a0a4e409
Author:     Mike Christie <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 12:57:07 2007 -0500
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Fri Jun 1 12:02:05 2007 -0400

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/scsi_transport_iscsi.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/scsi_transport_iscsi.c 
b/drivers/scsi/scsi_transport_iscsi.c
index caf1836..4fbd8e1 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to