Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937889AbdCJOTt (ORCPT ); Fri, 10 Mar 2017 09:19:49 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:42757 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933770AbdCJLvN (ORCPT ); Fri, 10 Mar 2017 06:51:13 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Wei Yongjun" , "Steve Wise" , "Doug Ledford" Date: Fri, 10 Mar 2017 11:46:22 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 083/370] iw_cxgb4: Fix error return code in c4iw_rdev_open() In-Reply-To: X-SA-Exim-Connect-IP: 82.70.136.246 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 986 Lines: 28 3.16.42-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Wei Yongjun commit 15f7e3c21b76598bc6e5816d2577ce843b2b963f upstream. Fix to return error code -ENOMEM from the __get_free_page() error handling case instead of 0, as done elsewhere in this function. Fixes: 05eb23893c2c ("cxgb4/iw_cxgb4: Doorbell Drop Avoidance Bug Fixes") Signed-off-by: Wei Yongjun Acked-by: Steve Wise Signed-off-by: Doug Ledford [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- --- a/drivers/infiniband/hw/cxgb4/device.c +++ b/drivers/infiniband/hw/cxgb4/device.c @@ -694,6 +694,7 @@ static int c4iw_rdev_open(struct c4iw_rd __get_free_page(GFP_KERNEL); if (!rdev->status_page) { pr_err(MOD "error allocating status page\n"); + err = -ENOMEM; goto err4; } rdev->status_page->db_off = 0;