serial: msm_geni_serial: Return error in probe upon memory allocation failure
Return error in probe when memory allocation fails for rx_fifo. Change-Id: Ic1d784dca2ffeb3aeaa71879d5538294df9de9ca Signed-off-by: Somesh Dey <quic_somedey@quicinc.com>
This commit is contained in:
parent
18039c1e1c
commit
0c8f1050da
1 changed files with 4 additions and 0 deletions
|
|
@ -5475,10 +5475,14 @@ static int msm_geni_serial_port_init(struct platform_device *pdev,
|
|||
if (dev_port->is_console) {
|
||||
dev_port->handle_rx = handle_rx_console;
|
||||
dev_port->rx_fifo = devm_kzalloc(uport->dev, sizeof(u32), GFP_KERNEL);
|
||||
if (!dev_port->rx_fifo)
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
dev_port->handle_rx = handle_rx_hs;
|
||||
dev_port->rx_fifo = devm_kzalloc(uport->dev,
|
||||
sizeof(dev_port->rx_fifo_depth * sizeof(u32)), GFP_KERNEL);
|
||||
if (!dev_port->rx_fifo)
|
||||
return -ENOMEM;
|
||||
if (dev_port->pm_auto_suspend_disable) {
|
||||
pm_runtime_set_active(&pdev->dev);
|
||||
pm_runtime_forbid(&pdev->dev);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue