Skip to contentSkip to conversation

serial S3: fix local structure malloc

PATCH Applied Juergen Beisert 2 participants 2 messages Mar 12, 2012 – Mar 13, 2012

lore
Share & tools
lore
#0 lore raw

Patch 2c5404651091e985c9009aa417d80fdaf50d7a68 introduces a private structure for the S3C based UARTs but still reserves the memory for the smaller structure which fails at runtime.

drivers/serial/serial_s3c.c +1 -1
index a5fd4ee..2bdc1df 100644
@@ -153,7 +153,7 @@ static int s3c_serial_probe(struct device_d *dev)
 	struct s3c_uart *priv;
 	struct console_device *cdev;
 
-	priv = xzalloc(sizeof(struct console_device));
+	priv = xzalloc(sizeof(struct s3c_uart));
 	cdev = &priv->cdev;
 	priv->regs = dev_request_mem_region(dev, 0);
 	dev->priv = priv;
Signature · 9 lines
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 5 lines · Juergen Beisert

Patch 2c5404651091e985c9009aa417d80fdaf50d7a68 introduces a private structure for the S3C based UARTs but still reserves the memory for the smaller structure which fails at runtime.

Applied to master, thanks

Sascha

Quoted 26 lines
drivers/serial/serial_s3c.c +1 -1
index a5fd4ee..2bdc1df 100644
@@ -153,7 +153,7 @@ static int s3c_serial_probe(struct device_d *dev)
 	struct s3c_uart *priv;
 	struct console_device *cdev;
 
-	priv = xzalloc(sizeof(struct console_device));
+	priv = xzalloc(sizeof(struct s3c_uart));
 	cdev = &priv->cdev;
 	priv->regs = dev_request_mem_region(dev, 0);
 	dev->priv = priv;
Signature · 10 lines
-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox