From patchwork Thu Mar 21 09:24:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10863187 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 6AE0B14DE for ; Thu, 21 Mar 2019 09:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EBC729E10 for ; Thu, 21 Mar 2019 09:25:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4190129E3E; Thu, 21 Mar 2019 09:25:18 +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=ham 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 83CE629E50 for ; Thu, 21 Mar 2019 09:25:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E144089F92; Thu, 21 Mar 2019 09:25:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2778389F92 for ; Thu, 21 Mar 2019 09:25:08 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2L9IlYn130499; Thu, 21 Mar 2019 09:25:02 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2r8ssrq8v0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Mar 2019 09:25:02 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2L9P1fb004283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Mar 2019 09:25:01 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2L9P0Ij022176; Thu, 21 Mar 2019 09:25:00 GMT Received: from kadam (/197.157.0.22) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 21 Mar 2019 02:25:00 -0700 Date: Thu, 21 Mar 2019 12:24:51 +0300 From: Dan Carpenter To: Jani Nikula , Chris Wilson Message-ID: <20190321092451.GK2202@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8736ng1u4f.fsf@gaia.fi.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9201 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-1903210068 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : sender : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=Chg4TRQlHz4MhIYgnKGAiCHdlf4q3vKixzyWLGNV7fs=; b=urZPRZNP/7MZLHsYhJWht1zx+bV7RMSB84fHEnI+UYvXcotPHAPAGwkAiuVGqB20gXOz nNM6zpA3Ebtsd6YerFwh2AWCFqtYWFodKOFLla0Q9IUASw7sh6OarKY1yXi+xZhku3fo yqvI1QSBo0wk9pUd9Y+oq+dTwQ2mTA4EGOOQiLoFKpSJ8kiX0XU41ldH60RBYlYJtSVg FBMlu1oC1JkIpi3h5Kb44BOzudkkH9j8EArDd7eGq5LygrCWWJPhQLtUJ9pgc+bqBABa Aj/mYGJRkjk165uV1Ysf6Lb5sw018EFA5uLMTEwr20y9S1LlJKxjG9KtmYbagTtrzmiK FQ== Subject: [Intel-gfx] [PATCH v2] drm/i915/selftests: fix NULL vs IS_ERR() check in mock_context_barrier() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , intel-gfx@lists.freedesktop.org, kernel-janitors@vger.kernel.org, Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The mock_context() function returns NULL on error, it doesn't return error pointers. Fixes: 85fddf0b0027 ("drm/i915: Introduce a context barrier callback") Signed-off-by: Dan Carpenter Reviewed-by: Mika Kuoppala --- V2: I accidentally sent a bunch of unrelated stuff... diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/selftests/i915_gem_context.c index 4399ef9ebf15..a172dbd9cb9e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_context.c @@ -1620,8 +1620,8 @@ static int mock_context_barrier(void *arg) mutex_lock(&i915->drm.struct_mutex); ctx = mock_context(i915, "mock"); - if (IS_ERR(ctx)) { - err = PTR_ERR(ctx); + if (!ctx) { + err = -ENOMEM; goto unlock; }