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

LEDE Commits lede-commits at lists.infradead.org
Tue Aug 18 06:01:27 EDT 2020


adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d0498872ff71a79f0676cfc6b6b547c499bff712

commit d0498872ff71a79f0676cfc6b6b547c499bff712
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>
---
 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 4559418de7..8861814be4 100644
--- a/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
+++ b/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c
@@ -480,7 +480,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