LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] platform/chrome: null check create_singlethread_workqueue
@ 2019-09-11 20:10 Navid Emamdoost
  2019-09-19 13:06 ` Enric Balletbo i Serra
  0 siblings, 1 reply; 2+ messages in thread
From: Navid Emamdoost @ 2019-09-11 20:10 UTC (permalink / raw)
  To: unlisted-recipients:; (no To-header on input)
  Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Benson Leung,
	Enric Balletbo i Serra, linux-kernel

In cros_usbpd_logger_probe the return value of
create_singlethread_workqueue may be null, it should be checked.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 drivers/platform/chrome/cros_usbpd_logger.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c
index 7c7b267626a0..c83397955cc3 100644
--- a/drivers/platform/chrome/cros_usbpd_logger.c
+++ b/drivers/platform/chrome/cros_usbpd_logger.c
@@ -209,6 +209,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd)
 	/* Retrieve PD event logs periodically */
 	INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check);
 	logger->log_workqueue =	create_singlethread_workqueue("cros_usbpd_log");
+	if (!logger->log_workqueue)
+		return -ENOMEM;
+
 	queue_delayed_work(logger->log_workqueue, &logger->log_work,
 			   CROS_USBPD_LOG_UPDATE_DELAY);
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: null check create_singlethread_workqueue
  2019-09-11 20:10 [PATCH] platform/chrome: null check create_singlethread_workqueue Navid Emamdoost
@ 2019-09-19 13:06 ` Enric Balletbo i Serra
  0 siblings, 0 replies; 2+ messages in thread
From: Enric Balletbo i Serra @ 2019-09-19 13:06 UTC (permalink / raw)
  To: Navid Emamdoost; +Cc: emamd001, smccaman, kjlu, Benson Leung, linux-kernel

Hi,

On 11/9/19 22:10, Navid Emamdoost wrote:
> In cros_usbpd_logger_probe the return value of
> create_singlethread_workqueue may be null, it should be checked.
> 
> Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
> ---

Applied for 5.4, the patch went to linux-next some time ago, so sorry for late
notice.

Thanks,
 Enric


>  drivers/platform/chrome/cros_usbpd_logger.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/platform/chrome/cros_usbpd_logger.c b/drivers/platform/chrome/cros_usbpd_logger.c
> index 7c7b267626a0..c83397955cc3 100644
> --- a/drivers/platform/chrome/cros_usbpd_logger.c
> +++ b/drivers/platform/chrome/cros_usbpd_logger.c
> @@ -209,6 +209,9 @@ static int cros_usbpd_logger_probe(struct platform_device *pd)
>  	/* Retrieve PD event logs periodically */
>  	INIT_DELAYED_WORK(&logger->log_work, cros_usbpd_log_check);
>  	logger->log_workqueue =	create_singlethread_workqueue("cros_usbpd_log");
> +	if (!logger->log_workqueue)
> +		return -ENOMEM;
> +
>  	queue_delayed_work(logger->log_workqueue, &logger->log_work,
>  			   CROS_USBPD_LOG_UPDATE_DELAY);
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 20:10 [PATCH] platform/chrome: null check create_singlethread_workqueue Navid Emamdoost
2019-09-19 13:06 ` Enric Balletbo i Serra

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox