From patchwork Wed Oct 30 16:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 178124 Delivered-To: patches@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp6119629ocf; Wed, 30 Oct 2019 09:30:46 -0700 (PDT) X-Received: by 2002:a63:1945:: with SMTP id 5mr267664pgz.157.1572453046322; Wed, 30 Oct 2019 09:30:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572453046; cv=none; d=google.com; s=arc-20160816; b=pTubps46KOAF8GST12/0lS379D6lswTFwv+YmJwIgFnW5o+9EbSic+T+xgTA8GdIkq mC+ySKUu4UASNfNMtjz4VRgS4acqHGD5MTYc8F4eSUhrS08focn5oGrg2Fe7XEO5jbMC IRcRyvg7S5Eq4nlxLHi5TxouFP7n8NFrS4KSOsuxhMkSpyuti+a1SK5DvC1WvZA6OVwG Bmg0Dq7oL18aVq2/7fMJYLh+6xVrsy9sKrEH14ID1brdIa62aPaE4gz40jWq7Eqi0Xn5 nhuYbKXJwSnaCbSL5qCSp4khacSGdj9XKrbyfsDRg6l3MMndIvbAN57OYzklfoT0fFui dfog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=frY6rw5HiV1E5VHgu13X5DYK6Y+AvDh4NtUT+hC+PqI=; b=se48LTcsmFJYAr3ozLdp8XUQoQAjP2AX/5bYwtPR6j2ju1Hvf/3PukZW2mULBc+dRD rl0GPa4d5vFIJ7shu6eK9GzTApFXvsfOn1mdFv3URHx1BNppJeGE6pG1m+JY8wSlN0Gh 9IoVi1mXDsH6rfwrC/Me5+4obwRP7y1RpEjDauPpL85s+GWKLvWaumVNXhVjrTGKvBm4 RrRlg8Gpd8+CjR7fdMQVi0hrXuZ9naC1hqr2uamjDysJ02GLiggi63TDDp1H1w0SH+SY wfmzEO+6dKzou5L2amdOEj/DdN4Qnv9ullwTDXYT7tOtVDseRvimktSRJnU8EUN0T98n oUWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xiVSPGDx; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c207sor3038342pfb.53.2019.10.30.09.30.45 for (Google Transport Security); Wed, 30 Oct 2019 09:30:46 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xiVSPGDx; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=frY6rw5HiV1E5VHgu13X5DYK6Y+AvDh4NtUT+hC+PqI=; b=xiVSPGDxmxZceTHX1TwbfKwSgrTnCXP1keP3yqLhCb2QykhTGMfAISQG0TV7mFhF+P aQEvPOX5/IvbMuwfcTeAfQsMyfpgq0qiKArAolTyu6qrvi05TOxS6g3gO7mhmaPqXp/F W1sD2dXJ3M9Y4HA0CJzYRFjL4gaQoo8r7h84OuAUvMHITOH9XX5jZGRMCZiVakWLGaoc XF2PDT4UISxQWOkJCTQnMNhbfUx2sjXBfH3zxLnIrgn1U/BpjpLmoumfFIUcRYGp7/Bn vQokEpZUa9jq9ARePC+qprFT1pUjfS8Su6HSkYELXXWb0rvseVFb1dPnh3wp6q4Eso/C hs+Q== 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; bh=frY6rw5HiV1E5VHgu13X5DYK6Y+AvDh4NtUT+hC+PqI=; b=amaQBdn/2L1oKUdL2RczgylqRem/upkhF4Ju+HjCyhXgxIFZEqpN5ZxexDj9CX3N5N ID+mXFSSk9OgazhqwnjNz+Smo+8SNH/0I43geQwLXe84zjmYXDr1ke8b1Y2QkNpJEwzl CkzgXEdBBKOMQBrH2qU+41PewaiuQ6fz4H72rrHTzUQN8dJBtXn8YNw8zfsyoayLrZq5 sNprd4/VuwKSWctpW376L5YSmPEdijfl+fpD0+noCX+JtIy+W+GSoE6K4k7kV6C8X02w 1lTq9XNwl1iRFdJ92AMpi6e4DwGbf9iKPKryyOxzC9KpHTm9mpk90r/X70sN0Stqf+Dd /nBA== X-Gm-Message-State: APjAAAVlflh0O+GE1Je5aOq3zUp2qgkRSV4XFRgrvQDMzm4qwcTJZhK+ E9vzbKviv8RiVzDbseWngyKq9rE/ X-Google-Smtp-Source: APXvYqxGP0mpS9c5+JBz15CTK6yxsgrFNZFBJzidVG93iroVyV1o1u9ByvmoY2tHDbIZRN1EQwda6Q== X-Received: by 2002:a62:5442:: with SMTP id i63mr151097pfb.220.1572453045057; Wed, 30 Oct 2019 09:30:45 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-67-170-172-113.hsd1.or.comcast.net. [67.170.172.113]) by smtp.gmail.com with ESMTPSA id o1sm388483pgm.1.2019.10.30.09.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 09:30:44 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Colin King , Sumit Semwal , Benjamin Gaignard , Liam Mark , Laura Abbott , Brian Starkey , "Andrew F . Davis" , dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, kernel-janitors@vger.kernel.org Subject: [PATCH] dma-buf: heaps: Fix redundant assignment to variable ret in system_heap.c Date: Wed, 30 Oct 2019 16:30:40 +0000 Message-Id: <20191030163040.70055-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 Colin King reported a coverity error: The variable ret is being assigned with a value that is never read, it is being re-assigned the same value on the err0 exit path. The assignment is redundant and hence can be removed. He had a fix, but Andrew Davis suggested a better solution (actually returning ret), so this patch implements that fix. Cc: Colin King Cc: Sumit Semwal Cc: Benjamin Gaignard Cc: Liam Mark Cc: Laura Abbott Cc: Brian Starkey Cc: Andrew F. Davis Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Cc: kernel-janitors@vger.kernel.org Addresses-Coverity: ("Unused value") Fixes: 47a32f9c1226 ("dma-buf: heaps: Add system heap to dmabuf heaps") Reported-by: Colin Ian King Suggested-by: Andrew F. Davis Signed-off-by: John Stultz --- drivers/dma-buf/heaps/system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c index 455782efbb32..9a56393e40b4 100644 --- a/drivers/dma-buf/heaps/system_heap.c +++ b/drivers/dma-buf/heaps/system_heap.c @@ -98,7 +98,7 @@ static int system_heap_allocate(struct dma_heap *heap, err0: kfree(helper_buffer); - return -ENOMEM; + return ret; } static const struct dma_heap_ops system_heap_ops = {