Skip to contentSkip to conversation

fix resource leak in pnp card_probe()

PATCH Superseded Jesper Juhl 1 participant 1 message Mar 26, 2006 Pnp support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix resource leak in pnp card_probe()

We can leak `clink' in drivers/pnp/card.c::card_probe()

---

 drivers/pnp/card.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)
drivers/pnp/card.c +3 -1
@@ -81,8 +81,10 @@ static int card_probe(struct pnp_card * 
 				}
 				kfree(clink);
 			}
-		} else
+		} else {
+			kfree(clink);
 			return 1;
+		}
 	}
 	return 0;
 }