From patchwork Wed May 11 00:13:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9064131 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9B651BF29F for ; Wed, 11 May 2016 00:14:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CD9E20172 for ; Wed, 11 May 2016 00:14:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8507E20160 for ; Wed, 11 May 2016 00:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092AbcEKAOA (ORCPT ); Tue, 10 May 2016 20:14:00 -0400 Received: from mail-by2on0084.outbound.protection.outlook.com ([207.46.100.84]:64606 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751890AbcEKAN7 (ORCPT ); Tue, 10 May 2016 20:13:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OFetaNSDZHSJ+Wk96/H+u5YgWZJks75grjLsMZDpu50=; b=XqBO/WAoodKEP6imVT2jdFbTfoN2doSRLXRlX1sj1ztMgRBVSNjcb1jCp9eVJzoBSphJXBRBdQDa3w/dQdMvCNA/9WnJJ3btV+x3SSx+xOJ5nsbCKkyYpO+zpx4x4Qnvm2VkIWNfOTXXJTQq0+tysYFpkRGoMAjLdoyO34mUWbQ= Received: from BLUPR0201CA0009.namprd02.prod.outlook.com (10.163.116.19) by BY2PR0201MB1863.namprd02.prod.outlook.com (10.163.75.29) with Microsoft SMTP Server (TLS) id 15.1.492.11; Wed, 11 May 2016 00:13:56 +0000 Received: from BY2FFO11FD033.protection.gbl (2a01:111:f400:7c0c::151) by BLUPR0201CA0009.outlook.office365.com (2a01:111:e400:52e7::19) with Microsoft SMTP Server (TLS) id 15.1.492.11 via Frontend Transport; Wed, 11 May 2016 00:13:56 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BY2FFO11FD033.mail.protection.outlook.com (10.1.14.218) with Microsoft SMTP Server (TLS) id 15.1.492.8 via Frontend Transport; Wed, 11 May 2016 00:13:56 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [172.22.12.162]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id A2.11.03047.D9872375; Tue, 10 May 2016 17:11:09 -0700 (PDT) Received: from milsmgip12.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.279.2; Tue, 10 May 2016 17:13:52 -0700 X-AuditID: ac160c69-5f3ff70000000be7-3a-5732789d4563 Received: from exp-402881.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 46.04.03935.04972375; Tue, 10 May 2016 17:13:52 -0700 (PDT) Subject: [PATCH 3/6] IB/srp: Fix srp_create_target() error handling To: Doug Ledford References: <573278D9.4050908@sandisk.com> CC: Christoph Hellwig , Sagi Grimberg , Laurence Oberman , "linux-rdma@vger.kernel.org" From: Bart Van Assche Message-ID: <57327940.3030206@sandisk.com> Date: Tue, 10 May 2016 17:13:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <573278D9.4050908@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrMLMWRmVeSWpSXmKPExsWyRoxnke7cCqNwg4XT1S1env/AarFy9VEm i2eHelkszn94xWSx7vV7FgdWj/P3NrJ47L7ZwObxft9VNo/Pm+QCWKK4bFJSczLLUov07RK4 Mh4vWMNYcFS44ubTXsYGxt0CXYycHBICJhJvb+9m7GLk4hASmMsksWPpYXYIZwejxINPrSww VVtOtEAlljJKrD83mx0kISzgLNHW0MUIYosIqElserUILC4koCWxsn0+K0gDs8BqRokvy14x gSTYBIwkvr2fCTaVF6io/ed7sDiLgKrEmvfPwAaJCkRIrF53jRmiRlDi5MwnYPWcAtoS/3f9 Z+ti5AAaqimxfpc+SJhZQF5i+9s5zCC7JARWsUqcmfCHDeIIdYmTS+YzTWAUnoVk1CyE9llI 2hcwMq9iFMvNzCnOTU8tMDTVK07MS8ksztZLzs/dxAiJiswdjHefeB9iFOBgVOLh3cFlGC7E mlhWXJl7iFGCg1lJhDen2ChciDclsbIqtSg/vqg0J7X4EKM0B4uSOK/bvS9hQgLpiSWp2amp BalFMFkmDk6pBsZF0a/qxHQvx/ArH5zPPtOw1Pa8xr0wu2YL6Zwg/cBUF6Uqf4XL7XITwo/a T750I81cwNXNVNwtOvtWTE3lwiNLinZsvGbo9tmEoSLp6ZnbXvvOl39syT/GZsHOf9bglqzM p8Yq0Z+67MHzpXQWVrSfL5l245uTddjDSdWpi8WVVqZevuUfpMRSnJFoqMVcVJwIANq5+s6G AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJJMWRmVeSWpSXmKPExsXCtZEjRdeh0ijc4MIZQ4uX5z+wWqxcfZTJ 4tmhXhaL8x9eMVmse/2exYHV4/y9jSweu282sHm833eVzePzJrkAligum5TUnMyy1CJ9uwSu jMcL1jAWHBWuuPm0l7GBcbdAFyMnh4SAicSWEy3sILaQwGJGiUvXwOLCAs4SbQ1djCC2iICa xKZXi6BqtCRWts9n7WLk4mAWWM0oca/vF1gRm4CRxLf3M1lAbF6govaf75lAbBYBVYk175+B 1YgKREisXneNGaJGUOLkzCdg9ZwC2hL/d/1nA7GZBdQl/sy7xAxhy0tsfzuHeQIj3ywkLbOQ lM1CUraAkXkVo1huZk5xbnpmgaGRXnFiXkpmcbZecn7uJkZwYHJG7WC8PtH8ECMTB6cUMAzY 5Oap6b0vOvvX/abWkvS5UZ8n3XCVF3MIP3iWNTJ6ZsTR8Pa2XB3Z9ykf03e8SVr4wuzC4Yv9 WXaHci/pOk8I1TvhvmCFI8P5JWek2eUNHwVevczryMBunHA+7/z1s0fz1D+oX00/mN1TxS3S 3re/QmxG96bNtzsuXrExfb98XmPAtEkTxZVYijMSDbWYi4oTAUHTVk78AQAA X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(9170700003)(117636001)(59896002)(5003600100002)(110136002)(4001350100001)(11100500001)(4326007)(106466001)(2950100001)(36756003)(189998001)(77096005)(2906002)(229853001)(92566002)(1220700001)(19580405001)(99136001)(230700001)(5008740100001)(19580395003)(23676002)(8936002)(86362001)(575784001)(50986999)(50466002)(586003)(65806001)(65956001)(76176999)(122286003)(53416004)(54356999)(87266999)(65816999)(6806005)(47776003)(87936001)(81166006)(62816006); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0201MB1863; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD033; 1:jLMfmUNrYJmm90LSqRnN6tFpu7sVpbOsgkErKOK878B7eIHqlh4QJDsx4P2XSYZ4NSHilbUEQLfG+SzeDhanZbq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L1jw6gtJr9DCxHRMxQKeAyq7Vza76eVoZGJIAQny3eLi2PISpCkxMySQ27lrHbzfnRvczhNalORJer5Gvs9S4m5fYb17itc2fEuvEADOYZTuNGGYMckvouiu4oDahNuY1mUlaPvahejiDEDk7arTrWcmDVITLdNz9uVYhvsD8z/5WlaPsiF9y3X/BArai25Mf6pXPR3AtrUjW/VpvGmy5MthytwFpuYnGOzB02azX7L2m3sJ/20hKiKAx15lv4zD5+3eWpz4gZ7X9Jdb6Sv2zvHPRwGdj3sBAzinokqbwOus2DIR4ElM2OhKmoNwAB1XtWERK5KeplrSOp9s tz7/kSA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(10201501046)(3002001)(6055026); SRVR:BY2PR0201MB1863; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0201MB1863; X-Forefront-PRVS: 0939529DE2 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTJQUjAyMDFNQjE4NjM7MjM6M05WT0ZIUDliK1ArdGRzdkxnemlqSUQx?= =?utf-8?B?bUNBbml2R3JEWm1kOHpkT08rSlF0UU1ucEFLTXhPQWgzV0pRZkxqY3lDN2hr?= =?utf-8?B?Z1U0bWs2bUZvRDRpUDFsOVNWYTBzQlFOejNUTlpmOXE3OEQ4dnV0dFJLY2VD?= =?utf-8?B?bEpKNkdteE54WnE1WkgydEdEcXlhQzdwckZoWjNpWXlMYmhPNXZkWkMwcXpq?= =?utf-8?B?a2E4ekdsMG9saVl6MGxkSk9MSGpDQm81Y00vMzB1QzdlZXNPejl5RXZIbFla?= =?utf-8?B?VzFQYlJuMkVVRVlSYXYySmV5OGlsaCt0ZVN3ak5tN3ZlU3BESSs2UjNTUXd2?= =?utf-8?B?WUwyMVl6cDdjd1ZqTzhTOWV4bzEwOTM0VjFQTmZKanlYRXU1MDNCWDVUZk9P?= =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93fMgNgIynP379MlRyS/B/2cYzqNwzc4iaBCF5iICsmCesbZdKWLp7OjR/lo70ty8p5fLYSO3AXE5JJuBZH5PTm2GPFkHz/LR0SiszgpCqi8wuErN SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2016 00:13:56.0337 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0201MB1863 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoid that the following kernel oops occurs if memory pool allocation fails: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] ib_drain_rq+0x0/0x20 [ib_core] Call Trace: [] srp_create_target+0xca6/0x13a9 [ib_srp] [] dev_attr_store+0x13/0x20 [] sysfs_kf_write+0x40/0x50 [] kernfs_fop_write+0x13c/0x180 [] __vfs_write+0x23/0xf0 [] vfs_write+0xa4/0x1a0 [] SyS_write+0x44/0xa0 [] entry_SYSCALL_64_fastpath+0x1c/0xac Fixes: 1dc7b1f10dcb ("IB/srp: use the new CQ API") Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Sagi Grimberg Cc: Laurence Oberman Cc: # v4.5+ Reviewed-by: Leon Romanovsky --- drivers/infiniband/ulp/srp/ib_srp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 74e3ec8..f4dc6f9 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -447,16 +447,16 @@ static struct srp_fr_pool *srp_alloc_fr_pool(struct srp_target_port *target) /** * srp_destroy_qp() - destroy an RDMA queue pair - * @ch: SRP RDMA channel. + * @qp: RDMA queue pair. * * Drain the qp before destroying it. This avoids that the receive * completion handler can access the queue pair while it is * being destroyed. */ -static void srp_destroy_qp(struct srp_rdma_ch *ch) +static void srp_destroy_qp(struct ib_qp *qp) { - ib_drain_rq(ch->qp); - ib_destroy_qp(ch->qp); + ib_drain_rq(qp); + ib_destroy_qp(qp); } static int srp_create_ch_ib(struct srp_rdma_ch *ch) @@ -529,7 +529,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) } if (ch->qp) - srp_destroy_qp(ch); + srp_destroy_qp(ch->qp); if (ch->recv_cq) ib_free_cq(ch->recv_cq); if (ch->send_cq) @@ -553,7 +553,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) return 0; err_qp: - srp_destroy_qp(ch); + srp_destroy_qp(qp); err_send_cq: ib_free_cq(send_cq); @@ -596,7 +596,7 @@ static void srp_free_ch_ib(struct srp_target_port *target, ib_destroy_fmr_pool(ch->fmr_pool); } - srp_destroy_qp(ch); + srp_destroy_qp(ch->qp); ib_free_cq(ch->send_cq); ib_free_cq(ch->recv_cq);