diff options
author | Amit Choudhary <amit2030@gmail.com> | 2007-05-08 03:26:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:02 -0400 |
commit | d9a2f4a4945ebff54c9a011e4dc6e92d899ae26d (patch) | |
tree | f2a6b0ef82232251701363f1f3da2d51d6f09c0f /drivers/char | |
parent | fd463870dc89cac0f590ea007e3a5210103b1b04 (diff) |
drivers/char/synclink.c: check kmalloc() return value
Signed-off-by: Amit Choudhary <amit2030@gmail.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/synclink.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index ce4db6f52362..f02a0795983f 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -4010,8 +4010,13 @@ static int mgsl_alloc_intermediate_txbuffer_memory(struct mgsl_struct *info) | |||
4010 | for ( i=0; i<info->num_tx_holding_buffers; ++i) { | 4010 | for ( i=0; i<info->num_tx_holding_buffers; ++i) { |
4011 | info->tx_holding_buffers[i].buffer = | 4011 | info->tx_holding_buffers[i].buffer = |
4012 | kmalloc(info->max_frame_size, GFP_KERNEL); | 4012 | kmalloc(info->max_frame_size, GFP_KERNEL); |
4013 | if ( info->tx_holding_buffers[i].buffer == NULL ) | 4013 | if (info->tx_holding_buffers[i].buffer == NULL) { |
4014 | for (--i; i >= 0; i--) { | ||
4015 | kfree(info->tx_holding_buffers[i].buffer); | ||
4016 | info->tx_holding_buffers[i].buffer = NULL; | ||
4017 | } | ||
4014 | return -ENOMEM; | 4018 | return -ENOMEM; |
4019 | } | ||
4015 | } | 4020 | } |
4016 | 4021 | ||
4017 | return 0; | 4022 | return 0; |