| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * 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/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | #include <linux/types.h> |
|---|
| 17 | 6 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 185 | 174 | drvdata = mci->pvt_info; |
|---|
| 186 | 175 | platform_set_drvdata(pdev, mci); |
|---|
| 187 | 176 | |
|---|
| 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 | + } |
|---|
| 190 | 181 | |
|---|
| 191 | 182 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 192 | 183 | if (!r) { |
|---|
| .. | .. |
|---|
| 254 | 245 | edac_mc_del_mc(&pdev->dev); |
|---|
| 255 | 246 | err: |
|---|
| 256 | 247 | devres_release_group(&pdev->dev, NULL); |
|---|
| 248 | +free: |
|---|
| 257 | 249 | edac_mc_free(mci); |
|---|
| 258 | 250 | return res; |
|---|
| 259 | 251 | } |
|---|