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 10:00:55 +0000 (12:00 +0200)
The test is meant to check the result of the preceding kmalloc()

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c

index 4559418de79316c030ad645bf77bb32d3bb2be56..8861814be440ac052539637f8737daf094c00f5c 100644 (file)
@@ -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 */