Skip to content

Commit

Permalink
cpm_uart: Initialize port.dev before it's used.
Browse files Browse the repository at this point in the history
Previously, this caused NULL to sometimes be passed as a device
to the DMA code.  With recent DMA changes, that now causes a BUG().

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
  • Loading branch information
Scott Wood authored and Kumar Gala committed Apr 6, 2009
1 parent d91e4ea commit bd86ef3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/serial/cpm_uart/cpm_uart_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,13 +1339,13 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev,

dev_set_drvdata(&ofdev->dev, pinfo);

/* initialize the device pointer for the port */
pinfo->port.dev = &ofdev->dev;

ret = cpm_uart_init_port(ofdev->node, pinfo);
if (ret)
return ret;

/* initialize the device pointer for the port */
pinfo->port.dev = &ofdev->dev;

return uart_add_one_port(&cpm_reg, &pinfo->port);
}

Expand Down

0 comments on commit bd86ef3

Please sign in to comment.