From patchwork Fri Apr 7 23:09:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 9670643 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 AB28D60364 for ; Fri, 7 Apr 2017 23:09:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C0CB285EE for ; Fri, 7 Apr 2017 23:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E89728636; Fri, 7 Apr 2017 23:09:36 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 708E8285EE for ; Fri, 7 Apr 2017 23:09:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756106AbdDGXJ3 (ORCPT ); Fri, 7 Apr 2017 19:09:29 -0400 Received: from mail.ispras.ru ([83.149.199.45]:37876 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbdDGXJ1 (ORCPT ); Fri, 7 Apr 2017 19:09:27 -0400 Received: from localhost.localdomain (ppp85-140-181-246.pppoe.mtu-net.ru [85.140.181.246]) by mail.ispras.ru (Postfix) with ESMTPSA id 1B6C054006F; Sat, 8 Apr 2017 02:09:25 +0300 (MSK) From: Alexey Khoroshilov To: Mauro Carvalho Chehab , Laurent Pinchart , Hans Verkuil Cc: Alexey Khoroshilov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] m2m-deinterlace: don't return zero on failure paths in deinterlace_probe() Date: Sat, 8 Apr 2017 02:09:17 +0300 Message-Id: <1491606557-18988-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If DMA does not support INTERLEAVE, deinterlace_probe() breaks off initialization, releases dma channel, but returns zero. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/platform/m2m-deinterlace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/m2m-deinterlace.c b/drivers/media/platform/m2m-deinterlace.c index bedc7cc4c7d6..980066b8d32a 100644 --- a/drivers/media/platform/m2m-deinterlace.c +++ b/drivers/media/platform/m2m-deinterlace.c @@ -1017,6 +1017,7 @@ static int deinterlace_probe(struct platform_device *pdev) if (!dma_has_cap(DMA_INTERLEAVE, pcdev->dma_chan->device->cap_mask)) { dev_err(&pdev->dev, "DMA does not support INTERLEAVE\n"); + ret = -ENODEV; goto rel_dma; }