diff options
| -rw-r--r-- | drivers/pnp/isapnp/core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index ee6d1ed502ff..bf52990a8e91 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -655,8 +655,10 @@ static int __init isapnp_create_device(struct pnp_card *card, if ((dev = isapnp_parse_device(card, size, number++)) == NULL) return 1; option = pnp_register_independent_option(dev); - if (!option) + if (!option) { + kfree(dev); return 1; + } pnp_add_card_device(card,dev); while (1) { |
