mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
chrome-platform fixes for v6.9-rc4
Fix a NULL pointer dereference. -----BEGIN PGP SIGNATURE----- iIkEABYIADEWIQS0yQeDP3cjLyifNRUrxTEGBto89AUCZhdDmxMcdHp1bmdiaUBr ZXJuZWwub3JnAAoJECvFMQYG2jz0xxkA/jvAXjiYanRj162Jbmy4A6toyW79oqkc z2hLT8cW1VW0APsGIAJtKET4x2W3Gf6Qv3uMwhNruM3V6YPuCR4pbsY5AA== =Sf7Q -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
346668f02a
@ -263,12 +263,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev)
|
||||
if (!ec_dev)
|
||||
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);
|
||||
init_waitqueue_head(&ec_uart->response.wait_queue);
|
||||
|
||||
@ -280,14 +274,6 @@ static int cros_ec_uart_probe(struct serdev_device *serdev)
|
||||
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 */
|
||||
ec_dev->phys_name = dev_name(dev);
|
||||
ec_dev->dev = dev;
|
||||
@ -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);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user