mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
[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 <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
parent
5c9cfeddbb
commit
239a7dc2fe
1 changed files with 4 additions and 6 deletions
|
@ -609,12 +609,10 @@ iscsi_if_send_reply(int pid, int seq, int type, int done, int multi,
|
||||||
int t = done ? NLMSG_DONE : type;
|
int t = done ? NLMSG_DONE : type;
|
||||||
|
|
||||||
skb = alloc_skb(len, GFP_ATOMIC);
|
skb = alloc_skb(len, GFP_ATOMIC);
|
||||||
/*
|
if (!skb) {
|
||||||
* FIXME:
|
printk(KERN_ERR "Could not allocate skb to send reply.\n");
|
||||||
* user is supposed to react on iferror == -ENOMEM;
|
return -ENOMEM;
|
||||||
* see iscsi_if_rx().
|
}
|
||||||
*/
|
|
||||||
BUG_ON(!skb);
|
|
||||||
|
|
||||||
nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0);
|
nlh = __nlmsg_put(skb, pid, seq, t, (len - sizeof(*nlh)), 0);
|
||||||
nlh->nlmsg_flags = flags;
|
nlh->nlmsg_flags = flags;
|
||||||
|
|
Loading…
Reference in a new issue