Commit 346668f0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of...

Merge tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux

Pull chrome platform fix from Tzung-Bi Shih:
 "Fix a NULL pointer dereference"

* tag 'tag-chrome-platform-fixes-for-v6.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
  platform/chrome: cros_ec_uart: properly fix race condition
parents e8c39d0f 5e700b38
...@@ -263,12 +263,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev) ...@@ -263,12 +263,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev)
if (!ec_dev) if (!ec_dev)
return -ENOMEM; return -ENOMEM;
ret = devm_serdev_device_open(dev, serdev);
if (ret) {
dev_err(dev, "Unable to open UART device");
return ret;
}
serdev_device_set_drvdata(serdev, ec_dev); serdev_device_set_drvdata(serdev, ec_dev);
init_waitqueue_head(&ec_uart->response.wait_queue); init_waitqueue_head(&ec_uart->response.wait_queue);
...@@ -280,14 +274,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev) ...@@ -280,14 +274,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev)
return ret; return ret;
} }
ret = serdev_device_set_baudrate(serdev, ec_uart->baudrate);
if (ret < 0) {
dev_err(dev, "Failed to set up host baud rate (%d)", ret);
return ret;
}
serdev_device_set_flow_control(serdev, ec_uart->flowcontrol);
/* Initialize ec_dev for cros_ec */ /* Initialize ec_dev for cros_ec */
ec_dev->phys_name = dev_name(dev); ec_dev->phys_name = dev_name(dev);
ec_dev->dev = dev; ec_dev->dev = dev;
...@@ -301,6 +287,20 @@ static int cros_ec_uart_probe(struct serdev_device *serdev) ...@@ -301,6 +287,20 @@ static int cros_ec_uart_probe(struct serdev_device *serdev)
serdev_device_set_client_ops(serdev, &cros_ec_uart_client_ops); serdev_device_set_client_ops(serdev, &cros_ec_uart_client_ops);
ret = devm_serdev_device_open(dev, serdev);
if (ret) {
dev_err(dev, "Unable to open UART device");
return ret;
}
ret = serdev_device_set_baudrate(serdev, ec_uart->baudrate);
if (ret < 0) {
dev_err(dev, "Failed to set up host baud rate (%d)", ret);
return ret;
}
serdev_device_set_flow_control(serdev, ec_uart->flowcontrol);
return cros_ec_register(ec_dev); return cros_ec_register(ec_dev);
} }
......
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