hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/ethernet/hisilicon/hns/hnae.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2014-2015 Hisilicon Limited.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
84 */
95
106 #include <linux/dma-mapping.h>
....@@ -274,7 +270,7 @@
274270 hnae_fini_ring(&q->rx_ring);
275271 }
276272
277
-/**
273
+/*
278274 * ae_chain - define ae chain head
279275 */
280276 static RAW_NOTIFIER_HEAD(ae_chain);
....@@ -423,8 +419,10 @@
423419 hdev->cls_dev.release = hnae_release;
424420 (void)dev_set_name(&hdev->cls_dev, "hnae%d", hdev->id);
425421 ret = device_register(&hdev->cls_dev);
426
- if (ret)
422
+ if (ret) {
423
+ put_device(&hdev->cls_dev);
427424 return ret;
425
+ }
428426
429427 __module_get(THIS_MODULE);
430428
....@@ -442,7 +440,7 @@
442440
443441 /**
444442 * hnae_ae_unregister - unregisters a HNAE AE engine
445
- * @cdev: the device to unregister
443
+ * @hdev: the device to unregister
446444 */
447445 void hnae_ae_unregister(struct hnae_ae_dev *hdev)
448446 {