Re: [PATCH] ehea: Fix: Remove adapter from adapter list in errorpath

From: Stefan Richter
Date: Wed Feb 11 2009 - 09:15:59 EST


Hannes Hering wrote:
> Remove adapter from adapter list before freeing data structure in error path.
...
> --- linux-2.6.29-rc4/drivers/net/ehea/ehea_main.c 2009-02-11 13:13:47.812542928 +0100
> +++ patched_kernel/drivers/net/ehea/ehea_main.c 2009-02-11 13:14:04.197540184 +0100
> @@ -3448,6 +3448,7 @@ out_kill_eq:
> ehea_destroy_eq(adapter->neq);
>
> out_free_ad:
> + list_del(&adapter->list);
> kfree(adapter);
>
> out:

On a related note, ehea_set_mac_addr()/ehea_update_bcmc_registrations()
accesses adapter_list without serialization by ehea_fw_handles.lock and
thus apparently unsafely.

There may be other unsafe accesses of adapter_list; that's just the
first one which I spotted.
--
Stefan Richter
-=====-==--= --=- -=-==
http://arcgraph.de/sr/
--
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/