diff options
-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; |