aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Hai <[email protected]>2020-11-10 22:46:14 +0800
committerJakub Kicinski <[email protected]>2020-11-11 17:52:01 -0800
commit52755b66ddcef2e897778fac5656df18817b59ab (patch)
treed13679d9a8b7fe3e1a5fcb20b7435ebb18727484
parent460cd17e9f7d60eaa22028baa6a056c478fa7dc6 (diff)
cosa: Add missing kfree in error path of cosa_write
If memory allocation for 'kbuf' succeed, cosa_write() doesn't have a corresponding kfree() in exception handling. Thus add kfree() for this function implementation. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wang Hai <[email protected]> Acked-by: Jan "Yenya" Kasprzak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
-rw-r--r--drivers/net/wan/cosa.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index f8aed0696d77..2369ca250cd6 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -889,6 +889,7 @@ static ssize_t cosa_write(struct file *file,
chan->tx_status = 1;
spin_unlock_irqrestore(&cosa->lock, flags);
up(&chan->wsem);
+ kfree(kbuf);
return -ERESTARTSYS;
}
}