diff mbox series

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

Message ID 20200818095731.9866-1-hacks@slashdirt.org
State Accepted
Headers show
Series [v2] generic: platform/mikrotik: fix incorrect test | expand

Commit Message

Thibaut Aug. 18, 2020, 9:57 a.m. UTC
The test is meant to check the result of the preceding kmalloc()

Signed-off-by: Thibaut VARĂˆNE <hacks@slashdirt.org>
---
 .../generic/files/drivers/platform/mikrotik/rb_hardconfig.c     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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 */