Fix uninitialized object usage in igc 6.12.
This commit is contained in:
parent
7294ebd078
commit
ab89464e11
|
|
@ -268,6 +268,11 @@ int igc_led_setup(struct igc_adapter *adapter)
|
||||||
|
|
||||||
mutex_init(&adapter->led_mutex);
|
mutex_init(&adapter->led_mutex);
|
||||||
|
|
||||||
|
if (get_ecdev(adapter)) {
|
||||||
|
adapter->leds = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
leds = kcalloc(IGC_NUM_LEDS, sizeof(*leds), GFP_KERNEL);
|
leds = kcalloc(IGC_NUM_LEDS, sizeof(*leds), GFP_KERNEL);
|
||||||
if (!leds)
|
if (!leds)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
@ -295,6 +300,10 @@ void igc_led_free(struct igc_adapter *adapter)
|
||||||
struct igc_led_classdev *leds = adapter->leds;
|
struct igc_led_classdev *leds = adapter->leds;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (get_ecdev(adapter)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < IGC_NUM_LEDS; i++)
|
for (i = 0; i < IGC_NUM_LEDS; i++)
|
||||||
led_classdev_unregister(&((leds + i)->led));
|
led_classdev_unregister(&((leds + i)->led));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue