Skip to content

Commit

Permalink
[PATCH] pcmcia: fix pcmcia_device_remove oops
Browse files Browse the repository at this point in the history
Fix pcmcia_device_remove NULL pointer dereference at shutdown.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
  • Loading branch information
Hugh Dickins authored and Dominik Brodowski committed Mar 31, 2006
1 parent 30bac7a commit b2f51a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static int pcmcia_device_remove(struct device * dev)
* all devices
*/
did = (struct pcmcia_device_id *) p_dev->dev.driver_data;
if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
(p_dev->socket->device_count != 0) &&
(p_dev->device_no == 0))
pcmcia_card_remove(p_dev->socket, p_dev);
Expand Down

0 comments on commit b2f51a1

Please sign in to comment.