Commit db2787b4 authored by Lucas Correia Villa Real's avatar Lucas Correia Villa Real Committed by Linus Torvalds

[PATCH] 2.5.31_drivers_i2c_i2c-philips-par.c

  This is a trivial patch already applied in the -ac tree for the 2.4.19 kernel.
  Patch for i2c-philips-par.c free() the memory in the case of problems loading
  the adapter.
parent 87650f2a
...@@ -201,6 +201,7 @@ static void i2c_parport_attach (struct parport *port) ...@@ -201,6 +201,7 @@ static void i2c_parport_attach (struct parport *port)
NULL); NULL);
if (!adapter->pdev) { if (!adapter->pdev) {
printk(KERN_ERR "i2c-philips-par: Unable to register with parport.\n"); printk(KERN_ERR "i2c-philips-par: Unable to register with parport.\n");
kfree(adapter);
return; return;
} }
...@@ -211,6 +212,7 @@ static void i2c_parport_attach (struct parport *port) ...@@ -211,6 +212,7 @@ static void i2c_parport_attach (struct parport *port)
if (parport_claim_or_block(adapter->pdev) < 0 ) { if (parport_claim_or_block(adapter->pdev) < 0 ) {
printk(KERN_ERR "i2c-philips-par: Could not claim parallel port.\n"); printk(KERN_ERR "i2c-philips-par: Could not claim parallel port.\n");
kfree(adapter);
return; return;
} }
/* reset hardware to sane state */ /* reset hardware to sane state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment