generic: platform/mikrotik: fix incorrect test
authorThibaut VARÈNE <hacks@slashdirt.org>
Tue, 18 Aug 2020 09:57:31 +0000 (11:57 +0200)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 18 Aug 2020 16:22:33 +0000 (18:22 +0200)
The test is meant to check the result of the preceding kmalloc()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
(cherry picked from commit d0498872ff71a79f0676cfc6b6b547c499bff712)

target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c

index 06530f7caaa3e9dbb91d943bfefae80c08bdeb6c..46dc476003c2673e6451a617ee2c946c0c7dc1a1 100644 (file)
@@ -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 */