lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20170327085220.GA26407@SEL-JYOUN-D1>
Date:   Mon, 27 Mar 2017 17:52:20 +0900
From:   Daeseok Youn <daeseok.youn@...il.com>
To:     mchehab@...nel.org
Cc:     gregkh@...uxfoundation.org, daeseok.youn@...il.com,
        alan@...ux.intel.com, dan.carpenter@...cle.com,
        singhalsimran0@...il.com, linux-media@...r.kernel.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: [PATCH] staging: atomisp: fix an issue timeout value for checking
 error

The timeout variable could be zero even if the bits has expected result.
The checking expected bits again would be better instead whether
the timeout value is zero or not.

Signed-off-by: Daeseok Youn <daeseok.youn@...il.com>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
index 94bc793..f2e5749 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
@@ -220,11 +220,11 @@ static int write_target_freq_to_hw(struct atomisp_device *isp,
 			timeout--;
 		}
 
-		if (timeout != 0)
+		if (!(isp_sspm1 & ISP_FREQ_VALID_MASK))
 			break;
 	}
 
-	if (timeout == 0) {
+	if (isp_sspm1 & ISP_FREQ_VALID_MASK) {
 		dev_err(isp->dev, "DFS failed due to HW error.\n");
 		return -EINVAL;
 	}
@@ -238,7 +238,7 @@ static int write_target_freq_to_hw(struct atomisp_device *isp,
 		udelay(100);
 		timeout--;
 	}
-	if (timeout == 0) {
+	if ((isp_sspm1 >> ISP_FREQ_STAT_OFFSET) != ratio) {
 		dev_err(isp->dev, "DFS target freq is rejected by HW.\n");
 		return -EINVAL;
 	}
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ