lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20241007152502.387840-1-wangtaowt166@163.com>
Date: Mon,  7 Oct 2024 23:25:02 +0800
From: tao <wangtaowt166@....com>
To: richardcochran@...il.com
Cc: netdev@...r.kernel.org,
	tao <wangtaowt166@....com>
Subject: [RFC] ptp: Delete invalided timestamp event queue code

used timestamp event queue In ptp_open func,  queue of ptp_clock_register
 already invalid so delete it

Signed-off-by: tao <wangtaowt166@....com>
---
 drivers/ptp/ptp_clock.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index c56cd0f63909..9be8136cb64c 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -235,7 +235,6 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
 				     struct device *parent)
 {
 	struct ptp_clock *ptp;
-	struct timestamp_event_queue *queue = NULL;
 	int err, index, major = MAJOR(ptp_devt);
 	char debugfsname[16];
 	size_t size;
@@ -260,20 +259,7 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
 	ptp->devid = MKDEV(major, index);
 	ptp->index = index;
 	INIT_LIST_HEAD(&ptp->tsevqs);
-	queue = kzalloc(sizeof(*queue), GFP_KERNEL);
-	if (!queue) {
-		err = -ENOMEM;
-		goto no_memory_queue;
-	}
-	list_add_tail(&queue->qlist, &ptp->tsevqs);
 	spin_lock_init(&ptp->tsevqs_lock);
-	queue->mask = bitmap_alloc(PTP_MAX_CHANNELS, GFP_KERNEL);
-	if (!queue->mask) {
-		err = -ENOMEM;
-		goto no_memory_bitmap;
-	}
-	bitmap_set(queue->mask, 0, PTP_MAX_CHANNELS);
-	spin_lock_init(&queue->lock);
 	mutex_init(&ptp->pincfg_mux);
 	mutex_init(&ptp->n_vclocks_mux);
 	init_waitqueue_head(&ptp->tsev_wq);
@@ -380,11 +366,6 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
 kworker_err:
 	mutex_destroy(&ptp->pincfg_mux);
 	mutex_destroy(&ptp->n_vclocks_mux);
-	bitmap_free(queue->mask);
-no_memory_bitmap:
-	list_del(&queue->qlist);
-	kfree(queue);
-no_memory_queue:
 	xa_erase(&ptp_clocks_map, index);
 no_slot:
 	kfree(ptp);
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ