From patchwork Wed May 22 13:57:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10955893 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 4CB70924 for ; Wed, 22 May 2019 13:57:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EE8726246 for ; Wed, 22 May 2019 13:57:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32A0228A77; Wed, 22 May 2019 13:57:38 +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 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 D6B6928BBF for ; Wed, 22 May 2019 13:57:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7D9A589A98; Wed, 22 May 2019 13:57:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820045.outbound.protection.outlook.com [40.107.82.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2496689A72; Wed, 22 May 2019 13:57:34 +0000 (UTC) Received: from SN1PR12CA0067.namprd12.prod.outlook.com (2603:10b6:802:20::38) by BYASPR01MB3.namprd12.prod.outlook.com (2603:10b6:a02:ce::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.15; Wed, 22 May 2019 13:57:32 +0000 Received: from CO1NAM03FT003.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::201) by SN1PR12CA0067.outlook.office365.com (2603:10b6:802:20::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.15 via Frontend Transport; Wed, 22 May 2019 13:57:31 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT003.mail.protection.outlook.com (10.152.80.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Wed, 22 May 2019 13:57:31 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Wed, 22 May 2019 08:57:29 -0500 From: Andrey Grodzovsky To: , , , Subject: [PATCH] drm/sched: Fix static checker warning for potential NULL ptr Date: Wed, 22 May 2019 09:57:23 -0400 Message-ID: <1558533443-7795-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(376002)(346002)(2980300002)(428003)(189003)(199004)(14444005)(356004)(51416003)(86362001)(44832011)(4326008)(7696005)(6666004)(2201001)(47776003)(48376002)(16586007)(110136005)(50466002)(476003)(426003)(186003)(2906002)(70206006)(2616005)(36756003)(50226002)(68736007)(8936002)(478600001)(305945005)(81156014)(53416004)(53936002)(77096007)(72206003)(316002)(81166006)(8676002)(5660300002)(70586007)(126002)(26005)(486006)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:BYASPR01MB3; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d658a8b4-faa4-4677-78d0-08d6debd6f2a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BYASPR01MB3; X-MS-TrafficTypeDiagnostic: BYASPR01MB3: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:457; X-Forefront-PRVS: 0045236D47 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 0WDx77GW0CP8TFMZLq6ATXbXgE6aI4f/JmoE1XG5BnwsRA4uI06LrmkPvnO5/xRWa+Z2y98U24pYqVGtDCV2sU0LldtE87TnzjAmlVE5qwZFGyXze+ydPrsE9y5Aarm36SWU5D28KR7L0OtuM5R+6491lxJG0wIpD9vNUM9Ju2JSFAaNjjZZP/nMrnQBfHY9TqVs5oHQbiCUzhec63icyi7kGuwOxOMW8yOOyhZruqRntpoLQWU82Y3JO2QtmyG3UFoq15C6eDfBzrQXOh8lSxnmlaP+Nd+ZT0+jZRZY/VKBg9QNNCkUZoC+KYWYOCKmVU61j3tOgSQJvo5QIAFf9bCg7AWEedm2JjUBkF2c7/M/BIfAc2mrYKuIHMlw+nL5/ZDcQQXlcdq5IeJ3kKOCTieHEy2lH9kVrhxT5yjhsmY= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2019 13:57:31.2771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d658a8b4-faa4-4677-78d0-08d6debd6f2a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYASPR01MB3 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sX4eUBBUYW5j6biUbpEOrWJ1FpWSVkU6jZRMlxTflaM=; b=Q2urI7fraYm/9ygArCLsPH9y7gb36FM/MamfEmDbgX/t4FLfZ7tO5zbQWNhOtQVDXphmuJOpIaYcJhDikgP8Klyt1Nn8daCw+N6V81zmyduzPeMZDITugNzxHeifUc5wnLylXjakSCqKJgsZ4frgAxzahCOLIXHeuLSN9RfkpeU= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=permerror action=none header.from=amd.com; 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Andrey Grodzovsky Reviewed-by: Christian König --- drivers/gpu/drm/scheduler/sched_main.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 90d7a82..ec7faca 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -286,16 +286,17 @@ static void drm_sched_job_timedout(struct work_struct *work) job = list_first_entry_or_null(&sched->ring_mirror_list, struct drm_sched_job, node); - if (job) + if (job) { job->sched->ops->timedout_job(job); - /* - * Guilty job did complete and hence needs to be manually removed - * See drm_sched_stop doc. - */ - if (sched->free_guilty) { - job->sched->ops->free_job(job); - sched->free_guilty = false; + /* + * Guilty job did complete and hence needs to be manually removed + * See drm_sched_stop doc. + */ + if (sched->free_guilty) { + job->sched->ops->free_job(job); + sched->free_guilty = false; + } } spin_lock_irqsave(&sched->job_list_lock, flags);