From patchwork Mon Aug 7 21:32:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 9886243 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 881AD602CC for ; Mon, 7 Aug 2017 21:32:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A3792870F for ; Mon, 7 Aug 2017 21:32:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F2C128715; Mon, 7 Aug 2017 21:32:39 +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=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID 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 C72D628711 for ; Mon, 7 Aug 2017 21:32:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2A3789FA6; Mon, 7 Aug 2017 21:32:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 15EA189DE1; Mon, 7 Aug 2017 21:32:35 +0000 (UTC) Received: by mail-it0-x243.google.com with SMTP id m34so1230957iti.0; Mon, 07 Aug 2017 14:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Olc0lE4jliGMBSY0h/nuX8tBQoJ+MtmkTxm8YV4+zeE=; b=vVjsG1nFYX5fyQFZSL04A2i3zoVtHY0W70jUX9w30Xn7a6Wit6theg1tY3G7vqhvmj 66FKJNlfpYczINg26/OLRwiXVRdBtVIj7tBlFuK0hwwpgdY+X3SxQj5FVcgpeJ6hXeU0 GJ4CY6qZAQ49tjFtVxqBqae2FMv4PX4ZOJcusbntkoAY54T5Uco4yauey3kkAHT+ccvm GyNN37yP1huzfeGULSSDWUUe+KgWhopjSTOYvn9Y0tT5kXMPV3H6JhP7n+J4nxU5y1ou 939nKKBuJ2oXFOby0Ym+BzNzPIEMuHS5yQbb5W2yPpr09Y4J9etSh28Ex9XiD2HVmU36 Gc6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Olc0lE4jliGMBSY0h/nuX8tBQoJ+MtmkTxm8YV4+zeE=; b=d1SwQIZehUwL9ewoq2iOwcBEwPPzvynUFOKeUqWTZSCuc9UMY2hgNvkyP5wTcr6d3i Gkvoju8/+kudnXMIe9yeJou6QjNjfXdLUzDFoQ+60OHpxjj4Wv0EB6h45/lLG6d9rQ0D zai/Qp3fA+z0/pAGByPu6fFhlyqZJdwecW2WT6Puz+wRu2S7nEtcOPw5StNS2JcUtXL2 qxWa62dIeKFrsQQX6GRio/qmy9ywDxESxPNkYhS8nW3T69mHt6Sz+xXJNK0bjW66ZRV0 FgVcVjU0eRNy8usc1CPMPJM1tKzW6N8GWnTizfhVKA07SlxLAk7DpMGIqN8y6e1rF17l JkfA== X-Gm-Message-State: AIVw113rvmhok9cXxMPm1/ObRbYUEyN494RlsoqIaMYFUvPTnR1qZoE+ tVRrJ0GhtyqLe9T0 X-Received: by 10.36.95.77 with SMTP id r74mr2184436itb.36.1502141554353; Mon, 07 Aug 2017 14:32:34 -0700 (PDT) Received: from cm.amd.com ([165.204.55.251]) by smtp.gmail.com with ESMTPSA id x131sm24302itf.17.2017.08.07.14.32.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 14:32:33 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, sumit.semwal@linaro.org, christian.koenig@amd.com Subject: [PATCH 1/3] dma-buf: dma_fence_put is NULL safe Date: Mon, 7 Aug 2017 17:32:21 -0400 Message-Id: <1502141543-13455-2-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1502141543-13455-1-git-send-email-alexander.deucher@amd.com> References: <1502141543-13455-1-git-send-email-alexander.deucher@amd.com> MIME-Version: 1.0 Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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 From: Christian König No need to check. Signed-off-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/dma-buf/reservation.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index 393817e..87f8f57 100644 --- a/drivers/dma-buf/reservation.c +++ b/drivers/dma-buf/reservation.c @@ -195,8 +195,7 @@ reservation_object_add_shared_replace(struct reservation_object *obj, if (old) kfree_rcu(old, rcu); - if (old_fence) - dma_fence_put(old_fence); + dma_fence_put(old_fence); } /** @@ -258,8 +257,7 @@ void reservation_object_add_excl_fence(struct reservation_object *obj, dma_fence_put(rcu_dereference_protected(old->shared[i], reservation_object_held(obj))); - if (old_fence) - dma_fence_put(old_fence); + dma_fence_put(old_fence); } EXPORT_SYMBOL(reservation_object_add_excl_fence);