hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/net/wireless/mediatek/mt7601u/init.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * (c) Copyright 2002-2010, Ralink Technology, Inc.
34 * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org>
45 * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2
8
- * as published by the Free Software Foundation
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 #include "mt7601u.h"
....@@ -565,6 +557,9 @@
565557 {
566558 dev->sband_2g = devm_kzalloc(dev->dev, sizeof(*dev->sband_2g),
567559 GFP_KERNEL);
560
+ if (!dev->sband_2g)
561
+ return -ENOMEM;
562
+
568563 dev->hw->wiphy->bands[NL80211_BAND_2GHZ] = dev->sband_2g;
569564
570565 WARN_ON(dev->ee->reg.start - 1 + dev->ee->reg.num >