.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * (c) Copyright 2002-2010, Ralink Technology, Inc. |
---|
3 | 4 | * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org> |
---|
4 | 5 | * 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. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #include "mt7601u.h" |
---|
.. | .. |
---|
565 | 557 | { |
---|
566 | 558 | dev->sband_2g = devm_kzalloc(dev->dev, sizeof(*dev->sband_2g), |
---|
567 | 559 | GFP_KERNEL); |
---|
| 560 | + if (!dev->sband_2g) |
---|
| 561 | + return -ENOMEM; |
---|
| 562 | + |
---|
568 | 563 | dev->hw->wiphy->bands[NL80211_BAND_2GHZ] = dev->sband_2g; |
---|
569 | 564 | |
---|
570 | 565 | WARN_ON(dev->ee->reg.start - 1 + dev->ee->reg.num > |
---|