[openwrt/openwrt] generic: platform/mikrotik: fix incorrect test

LEDE Commits lede-commits at lists.infradead.org
Tue Aug 18 12:23:14 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/d8ecaef409517c3c09381bee648e7beb35ae4329

commit d8ecaef409517c3c09381bee648e7beb35ae4329
Author: Thibaut VARÈNE <hacks at slashdirt.org>
AuthorDate: Tue Aug 18 11:57:31 2020 +0200

    generic: platform/mikrotik: fix incorrect test
    
    The test is meant to check the result of the preceding kmalloc()
    
    Signed-off-by: Thibaut VARÈNE <hacks at slashdirt.org>
    (cherry picked from commit d0498872ff71a79f0676cfc6b6b547c499bff712)
---
 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
index 06530f7caa..46dc476003 100644
--- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
+++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
@@ -495,7 +495,7 @@ static int hc_wlan_data_unpack_lzor(const u8 *inbuf, size_t inlen,
 	/* Temporary buffer same size as the outbuf */
 	templen = *outlen;
 	tempbuf = kmalloc(templen, GFP_KERNEL);
-	if (!outbuf)
+	if (!tempbuf)
 		return -ENOMEM;
 
 	/* Concatenate into the outbuf */



More information about the lede-commits mailing list