From patchwork Mon Mar 25 09:23:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10868469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87C6817E0 for ; Mon, 25 Mar 2019 09:24:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 733B428F83 for ; Mon, 25 Mar 2019 09:24:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 672D929041; Mon, 25 Mar 2019 09:24:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3035028F83 for ; Mon, 25 Mar 2019 09:24:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F1EF6E69F; Mon, 25 Mar 2019 09:24:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by gabe.freedesktop.org (Postfix) with ESMTPS id A884289973; Mon, 25 Mar 2019 09:24:11 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2P9NgJi191123; Mon, 25 Mar 2019 09:24:05 GMT Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2re6g0tuhr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Mar 2019 09:24:05 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2P9NxFw022788 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Mar 2019 09:23:59 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2P9NwcR001464; Mon, 25 Mar 2019 09:23:58 GMT Received: from kadam (/197.157.34.176) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 Mar 2019 02:23:58 -0700 Date: Mon, 25 Mar 2019 12:23:49 +0300 From: Dan Carpenter To: Jani Nikula , Chris Wilson Subject: [PATCH] drm/i915: Fix an error code in i915_gem_context_open() Message-ID: <20190325092349.GF16023@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9205 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903250071 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=Il6DT5Irlfv3YkUfjSae3BHnIz0qO7jSlnrwISF9Z5w=; b=TF5o31BNQB71z5XZSqcvkEV0TqgLO/QpO5CxgFJYwFqQva8U/V2ZjJJf1L+A+FokVhQo ohGUNOUdaQ3YC9QYPXWU0l76LdekAJ0iGvwPzCpk4gOYsFqVWrmvRo4MYyWsIAV0l9IB GLxUE6uyf790A55ZpEG2P/nwAhRoxedFPnINxekcR3OZtX0R/Xs4hSHsS9tM3/hMercy 1lacWjrvvNSI8N+97dgicLJEhSB52KCR06yqkCwdmR66SRNzthFDYNCZtVmdNBJQg4dw lPOCDKmhMqnkQJkbX72QEgeVHpxWn1f4LvwRRMq1e2z6KeWxFPQa97I+6T+nl7kYm/tq xg== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, Rodrigo Vivi Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP If gem_context_register() fails then "ctx" is a valid pointer, not an error pointer. We should just return "err". Fixes: 3aa9945a528e ("drm/i915: Separate GEM context construction and registration to userspace") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/i915_gem_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index e6f594668245..25f267a03d3d 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -709,7 +709,7 @@ int i915_gem_context_open(struct drm_i915_private *i915, idr_destroy(&file_priv->context_idr); mutex_destroy(&file_priv->vm_idr_lock); mutex_destroy(&file_priv->context_idr_lock); - return PTR_ERR(ctx); + return err; } void i915_gem_context_close(struct drm_file *file)