Re: [PATCH 2/3] Add rfkill support to compal-laptop

From: Johannes Berg
Date: Wed Aug 19 2009 - 13:14:16 EST


Hi Mario,

First, let me say I agree with Alan, the option 1 is more desirable if
possible to do with the hardware. But this looks ok from an rfkill POV
now, except there's a small bug:

> + ret = setup_rfkill();
> + if (ret)
> + printk(KERN_WARNING "compal-laptop: Unable to setup
> rfkill\n");

That doesn't error out, so

> + rfkill_unregister(wifi_rfkill);
> + rfkill_destroy(wifi_rfkill);
> + rfkill_unregister(bt_rfkill);
> + rfkill_destroy(bt_rfkill);

this will crash without NULL checks.

(and you have to explicitly assign NULL in setup_rfkill() too, when
bluetooth fails and wifi is freed)

johannes

Attachment: signature.asc
Description: This is a digitally signed message part