Re: [PATCH] firmware/dmi_scan: Drop OOM messages

From: Joe Perches
Date: Wed Jul 10 2013 - 10:51:37 EST


even more trivial...

On Wed, 2013-07-10 at 14:47 +0200, Jean Delvare wrote:
> +++ linux-3.11-rc0/drivers/firmware/dmi_scan.c 2013-07-10 14:11:56.544792703 +0200
> @@ -62,8 +62,6 @@ static const char * __init dmi_string(co
> str = dmi_alloc(len);
> if (str != NULL)
[]
> @@ -219,10 +217,8 @@ static void __init dmi_save_one_device(i
> dev = dmi_alloc(sizeof(*dev) + strlen(name) + 1);
> + if (!dev)
> return;
[]
> @@ -258,10 +254,8 @@ static void __init dmi_save_oem_strings_
> dev = dmi_alloc(sizeof(*dev));
> + if (!dev)
> break;
[]
> @@ -277,18 +271,14 @@ static void __init dmi_save_ipmi_device(
> data = dmi_alloc(dm->length);
> + if (data == NULL)
> return;
[]
> dev = dmi_alloc(sizeof(*dev));
> + if (!dev)
> return;
[]
> @@ -303,10 +293,9 @@ static void __init dmi_save_dev_onboard(
> onboard_dev = dmi_alloc(sizeof(*onboard_dev) + strlen(name) + 1);
> + if (!onboard_dev)
> return;

It'd also be nice to use the same test style
in all 6 uses.

if (!foo)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/