| .. | .. |
|---|
| 73 | 73 | static int atmel_probe(struct pcmcia_device *p_dev) |
|---|
| 74 | 74 | { |
|---|
| 75 | 75 | struct local_info *local; |
|---|
| 76 | + int ret; |
|---|
| 76 | 77 | |
|---|
| 77 | 78 | dev_dbg(&p_dev->dev, "atmel_attach()\n"); |
|---|
| 78 | 79 | |
|---|
| .. | .. |
|---|
| 83 | 84 | |
|---|
| 84 | 85 | p_dev->priv = local; |
|---|
| 85 | 86 | |
|---|
| 86 | | - return atmel_config(p_dev); |
|---|
| 87 | | -} /* atmel_attach */ |
|---|
| 87 | + ret = atmel_config(p_dev); |
|---|
| 88 | + if (ret) |
|---|
| 89 | + goto err_free_priv; |
|---|
| 90 | + |
|---|
| 91 | + return 0; |
|---|
| 92 | + |
|---|
| 93 | +err_free_priv: |
|---|
| 94 | + kfree(p_dev->priv); |
|---|
| 95 | + return ret; |
|---|
| 96 | +} |
|---|
| 88 | 97 | |
|---|
| 89 | 98 | static void atmel_detach(struct pcmcia_device *link) |
|---|
| 90 | 99 | { |
|---|
| .. | .. |
|---|
| 117 | 126 | |
|---|
| 118 | 127 | static int atmel_config(struct pcmcia_device *link) |
|---|
| 119 | 128 | { |
|---|
| 120 | | - struct local_info *dev; |
|---|
| 121 | 129 | int ret; |
|---|
| 122 | 130 | const struct pcmcia_device_id *did; |
|---|
| 123 | 131 | |
|---|
| 124 | | - dev = link->priv; |
|---|
| 125 | 132 | did = dev_get_drvdata(&link->dev); |
|---|
| 126 | 133 | |
|---|
| 127 | 134 | dev_dbg(&link->dev, "atmel_config\n"); |
|---|