Commit e4aa85cf authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'microchip-fixes'



Shang XiaoJing says:

====================
net: microchip: Fix potential null-ptr-deref due to create_singlethread_workqueue()

There are some functions call create_singlethread_workqueue() without
checking ret value, and the NULL workqueue_struct pointer may causes
null-ptr-deref. Will be fixed by this patch.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4e0c19fc 639f5d00
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -716,6 +716,9 @@ int lan966x_stats_init(struct lan966x *lan966x)
	snprintf(queue_name, sizeof(queue_name), "%s-stats",
		 dev_name(lan966x->dev));
	lan966x->stats_queue = create_singlethread_workqueue(queue_name);
	if (!lan966x->stats_queue)
		return -ENOMEM;

	INIT_DELAYED_WORK(&lan966x->stats_work, lan966x_check_stats_work);
	queue_delayed_work(lan966x->stats_queue, &lan966x->stats_work,
			   LAN966X_STATS_CHECK_DELAY);
+3 −0
Original line number Diff line number Diff line
@@ -1253,6 +1253,9 @@ int sparx_stats_init(struct sparx5 *sparx5)
	snprintf(queue_name, sizeof(queue_name), "%s-stats",
		 dev_name(sparx5->dev));
	sparx5->stats_queue = create_singlethread_workqueue(queue_name);
	if (!sparx5->stats_queue)
		return -ENOMEM;

	INIT_DELAYED_WORK(&sparx5->stats_work, sparx5_check_stats_work);
	queue_delayed_work(sparx5->stats_queue, &sparx5->stats_work,
			   SPX5_STATS_CHECK_DELAY);
+3 −0
Original line number Diff line number Diff line
@@ -659,6 +659,9 @@ static int sparx5_start(struct sparx5 *sparx5)
	snprintf(queue_name, sizeof(queue_name), "%s-mact",
		 dev_name(sparx5->dev));
	sparx5->mact_queue = create_singlethread_workqueue(queue_name);
	if (!sparx5->mact_queue)
		return -ENOMEM;

	INIT_DELAYED_WORK(&sparx5->mact_work, sparx5_mact_pull_work);
	queue_delayed_work(sparx5->mact_queue, &sparx5->mact_work,
			   SPX5_MACT_PULL_DELAY);