forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/edac/highbank_mc_edac.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2011-2012 Calxeda, Inc.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
154 */
165 #include <linux/types.h>
176 #include <linux/kernel.h>
....@@ -185,8 +174,10 @@
185174 drvdata = mci->pvt_info;
186175 platform_set_drvdata(pdev, mci);
187176
188
- if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL))
189
- return -ENOMEM;
177
+ if (!devres_open_group(&pdev->dev, NULL, GFP_KERNEL)) {
178
+ res = -ENOMEM;
179
+ goto free;
180
+ }
190181
191182 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
192183 if (!r) {
....@@ -254,6 +245,7 @@
254245 edac_mc_del_mc(&pdev->dev);
255246 err:
256247 devres_release_group(&pdev->dev, NULL);
248
+free:
257249 edac_mc_free(mci);
258250 return res;
259251 }