| author | Antonio Ospite <ospite@studenti.unina.it> | 2011-04-08 10:25:24 (GMT) |
|---|---|---|
| committer | Antonio Ospite <ospite@studenti.unina.it> | 2011-04-08 10:25:24 (GMT) |
| commit | aebdf1c5834e7eeec44e2e0a15a2bc0323931f42 (patch) (side-by-side diff) | |
| tree | c3e8b2b3072fc7cfc8dd02d3ff006697bff2bfcc | |
| parent | d054959b2bfe6b607afcc56718e0c0b891a715c9 (diff) | |
ezx/rfkill-bluetooth: assign rfkill_data fileds before rfkill_register()
This avoids a NULL pointer dereference in set_block() when it is called
by the related workqueue before rfkill_register() finish its execution.
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
| -rw-r--r-- | net/rfkill/rfkill-regulator.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/rfkill/rfkill-regulator.c b/net/rfkill/rfkill-regulator.c index 549f1d4..e99567f 100644 --- a/net/rfkill/rfkill-regulator.c +++ b/net/rfkill/rfkill-regulator.c @@ -99,6 +99,8 @@ static int __devinit rfkill_regulator_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Regulator already enabled\n"); rfkill_data->reg_enabled = 1; } + rfkill_data->vcc = vcc; + rfkill_data->rf_kill = rf_kill; ret = rfkill_register(rf_kill); if (ret) { @@ -106,9 +108,6 @@ static int __devinit rfkill_regulator_probe(struct platform_device *pdev) goto err_rfkill_register; } - rfkill_data->rf_kill = rf_kill; - rfkill_data->vcc = vcc; - platform_set_drvdata(pdev, rfkill_data); dev_info(&pdev->dev, "initialized\n"); |
