Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1598342ybt; Thu, 2 Jul 2020 09:09:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4SOMOFM04pQSUC3XRsJhNqxQwfpG5bZkIcJWuhbAYduyEs9EGjspto0FbLtR43A9iplN5 X-Received: by 2002:a17:906:8588:: with SMTP id v8mr29451567ejx.211.1593706142281; Thu, 02 Jul 2020 09:09:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593706142; cv=none; d=google.com; s=arc-20160816; b=QcI6NQpvP3GZ13w+IVES1ECTbZF/vZ7P/bo/+cBmlZOiYXH9GxL8hhHVkW4CjEP5yV IbeesURGHATjgvq5MEdtLnkNZuX2P/exOteo/kJE/OaO89YsI/uDe5ZdLGy0Q8gyDOR5 pqwXVNb+Cf750KiV2DgwlG18HDKnhWfYpnKvU3RKvoOg/MpgdB7dHIDuBILAGQF+eHe2 3qhfBfta+GwHP7qlIUOX3iVQ35BICuRagLqIzFZv8AdP9H/KQwHMaDtrRzu7ZKcyyEHb 1I++7aolH+XDA0JXHgLWj3RlZJwFF+8oyyEVCbwWL5uHzA4C4wZWGU1/DZlb+bqXkIFR apvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=nC9+n1ovR26FbjbV6Zh9/35302iXU6XT68k2CVdGBJI=; b=RMkGX81lkOje5SOqtt3XaxDgbO0G8aIyI6bxMGYVW9+EVFm0AM8Obpv1+a9Of/OkFM suVtYWjlfC6dPC8YqAR6nrQNFQpQP4Iyb7/Ujc86phgXs33AXm1rsjie4GAoHDr4oltO q6uIuRgPNCsufMNTrBh05BHQuqkIzoqCqchVmwsAOUMoZMIixH8Zbn47T/B80W4aF4bg K9yv1dN9uUJu8/bFvq2QAaLAqZXP+YTgHwWVPVf6Gk7udycUuIZalfFn0Tn/exV7NGOB pTRnE6I+zZ4T+yGMK4AO4FZdVhSjB4V8iPPq4HlJLKnsqDhnvafHbjv5rRtT0vISz7T3 ByIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn1si7805154ejc.638.2020.07.02.09.08.39; Thu, 02 Jul 2020 09:09:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgGBQFp (ORCPT + 99 others); Thu, 2 Jul 2020 12:05:45 -0400 Received: from winnie.ispras.ru ([83.149.199.91]:16121 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726119AbgGBQFp (ORCPT ); Thu, 2 Jul 2020 12:05:45 -0400 Received: from home.intra.ispras.ru (unknown [10.10.165.12]) by smtp.ispras.ru (Postfix) with ESMTP id C2875201D0; Thu, 2 Jul 2020 19:05:41 +0300 (MSK) From: Evgeny Novikov To: Bartlomiej Zolnierkiewicz Cc: Evgeny Novikov , Sekhar Nori , Bartosz Golaszewski , Daniel Vetter , Jani Nikula , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] fbdev: da8xx-fb: go to proper label on error handling paths in probe Date: Thu, 2 Jul 2020 19:05:40 +0300 Message-Id: <20200702160540.24546-1-novikov@ispras.ru> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fb_probe() can successfully allocate a new frame buffer, but then fail to perform some operations with regulator. In these cases fb_probe() goes to label err_pm_runtime_disable where the frame buffer is not released. The patch makes fb_probe() to go to label err_release_fb on corresponding error handling paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Evgeny Novikov --- drivers/video/fbdev/da8xx-fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/da8xx-fb.c b/drivers/video/fbdev/da8xx-fb.c index 73c3c4c8cc12..e38c0e3f9c61 100644 --- a/drivers/video/fbdev/da8xx-fb.c +++ b/drivers/video/fbdev/da8xx-fb.c @@ -1402,14 +1402,14 @@ static int fb_probe(struct platform_device *device) if (IS_ERR(par->lcd_supply)) { if (PTR_ERR(par->lcd_supply) == -EPROBE_DEFER) { ret = -EPROBE_DEFER; - goto err_pm_runtime_disable; + goto err_release_fb; } par->lcd_supply = NULL; } else { ret = regulator_enable(par->lcd_supply); if (ret) - goto err_pm_runtime_disable; + goto err_release_fb; } fb_videomode_to_var(&da8xx_fb_var, lcdc_info); -- 2.16.4