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:
Somesh Dey 2024-10-08 13:48:56 +05:30
parent 18039c1e1c
commit 0c8f1050da

View file

@ -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);