iio: Be consistent with allocation result tests.
authorJoe Simmons-Talbott <joetalbott@gmail.com>
Mon, 18 Jul 2022 02:03:48 +0000 (22:03 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 18 Jul 2022 17:29:30 +0000 (18:29 +0100)
Make both allocation result tests use the same format

    if (!ptr)

Signed-off-by: Joe Simmons-Talbott <joetalbott@gmail.com>
Link: https://lore.kernel.org/r/20220718020348.32047-1-joetalbott@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-trigger.c

index 3e1b1fb..b78814d 100644 (file)
@@ -365,7 +365,7 @@ struct iio_poll_func
        struct iio_poll_func *pf;
 
        pf = kmalloc(sizeof(*pf), GFP_KERNEL);
-       if (pf == NULL)
+       if (!pf)
                return NULL;
        va_start(vargs, fmt);
        pf->name = kvasprintf(GFP_KERNEL, fmt, vargs);