Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754746AbcDKQ4Z (ORCPT ); Mon, 11 Apr 2016 12:56:25 -0400 Received: from mail-bn1bbn0100.outbound.protection.outlook.com ([157.56.111.100]:59904 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750705AbcDKQ4V (ORCPT ); Mon, 11 Apr 2016 12:56:21 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; From: Stuart Yoder To: , CC: , , , , , =?UTF-8?q?Horia=20Geant=C4=83?= , Stuart Yoder Subject: [PATCH 13/14] staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failures Date: Mon, 11 Apr 2016 11:56:16 -0500 Message-ID: <1460393776-16500-1-git-send-email-stuart.yoder@nxp.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131048673784829815;(91ab9b29-cfa4-454e-5278-08d120cd25b8);() X-Forefront-Antispam-Report: CIP:192.88.168.50;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(50226001)(81166005)(92566002)(2870700001)(36756003)(86362001)(33646002)(11100500001)(47776003)(105606002)(4326007)(2906002)(189998001)(5820100001)(5008740100001)(50466002)(104016004)(6806005)(5001770100001)(19580395003)(87936001)(77096005)(106466001)(50986999)(586003)(23676002)(19580405001)(1096002)(1220700001)(7059030)(4720700001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR0301MB0718;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD052;1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8ASNdWa+15uBf7Sex9g7vMP0CaTzoYfaIUh4Erak1vVH/oa1r0xhuULqsMaMwl25Daf+1jYmjtYOefkYlEFZUbrxhd9BKQPFrOBCZxpy1yHxwVLgcZrBEKElyxDegUxwvYdl115XYbZD73hOfbcV0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB0718; X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0718;25:nW7O083NX0NbOOsdCwjuFD+/a57eRjBXzJR6E2u46nNU/YIdaxgjidgV4m639jzpZzu+SYvGHEsi/P0oKNzjosDzB19KAu70t39k78UZlpG0ooi6ubqTqSyy0yNyClxugbx/VHD2SF32fTbrvTgHatGXJ4F57cZL6TknooGX1cZbi6c8MYJ/8cnB4uo6Oq6Nt1HozfVltqni0XChmkfHJHimWsoUlbspgZ5XVjOceuCtHeeATUkWXoQ4P82mcOod/GDNA1OCFg7hB5fQupNC96Hc0JD8OS2vU6azdfCCLyISl9IAZ5Zo9BGMSAJmWBK21DWgDvDlffe2wJRgjEglctYDKGxZ06A9XqlDBzia6VmplWTXl9NSfCMYL5lt1SEjS67Zo/y0XhiE4SZ6SzCRayZsTA5jYj8iUGJqiMZqL0ZkIWix/TBUVOY+1dLkPMkWp0atOcp+aF7K6wCbYj5LZMdvDct1HBIM8juayc/Kklc2E5Yxv16Q7huFokFcnMNEGCEn2wzHCTTWvHuWOzVEXGtvJncZ3cvT8hBY2WuaNvEg3Z5H+OLcme9mhT7k5aZUnSEQCOY3ySaonWKjeoUvpV+6tg6T6mqwQVkUgo1XRO5JW7YpQrJkEBJn50XMBe2k6g60AaoTZ/OamAYLgSTPzA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13018025)(13017025)(13015025)(13023025)(13024025)(5005006)(8121501046)(3002001)(10201501046)(6055026);SRVR:DM2PR0301MB0718;BCL:0;PCL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ZWbTBwakZGem1JZkVRQkVVUTFqZUdQSWI2RWVrbTUwOFRES1R6?= =?utf-8?B?bTVFT2NLMjRYUzErVUFnT0F1YzRkVG5KMEsxb094RmVUdlV5UUlqWEhoS0JV?= =?utf-8?Q?2zqc9eo3Ts?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR0301MB0718;5:qqfSoVT6FP4XXgurjTqFWVgA5OZw47a4ki77cvPwm8yz9Jf1UoVF85rIfSGsttCMqpp6X0OH+cGoo4yMU7sR869XoqAJPzkjVd47PFfhkloTGOBTI51WmRJ8teZ2VvK/Own93gvn7CwAvvyb4vD9oKR/siCyDRNmQZdLYRzsBxs=;24:5VYy9qFufHHP7dmrEBZs/kjqZzCouF8im707OeEdIDpnDDqo9U1+XacAE4Ws2f1Aqpb7Lu0VXcp+E7K0XK9OPJdkA4UJdVX6SNdvO/nvefo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2016 16:56:18.2801 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB0718 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 816 Lines: 25 From: Horia Geantă There are some error paths that allow for a NULL new_mc_io and err = 0 return code. Return -EINVAL instead. Signed-off-by: Horia Geantă Signed-off-by: Stuart Yoder --- drivers/staging/fsl-mc/bus/mc-allocator.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/fsl-mc/bus/mc-allocator.c b/drivers/staging/fsl-mc/bus/mc-allocator.c index 4676ba1..7ee71e7 100644 --- a/drivers/staging/fsl-mc/bus/mc-allocator.c +++ b/drivers/staging/fsl-mc/bus/mc-allocator.c @@ -306,6 +306,7 @@ int __must_check fsl_mc_portal_allocate(struct fsl_mc_device *mc_dev, if (error < 0) return error; + error = -EINVAL; dpmcp_dev = resource->data; if (WARN_ON(!dpmcp_dev)) goto error_cleanup_resource; -- 1.7.9.5