From patchwork Wed Jan 10 09:36:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10154645 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 7394D60231 for ; Wed, 10 Jan 2018 09:38:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68E3F22064 for ; Wed, 10 Jan 2018 09:38:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CCE024603; Wed, 10 Jan 2018 09:38: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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 1029522064 for ; Wed, 10 Jan 2018 09:38:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965397AbeAJJhx (ORCPT ); Wed, 10 Jan 2018 04:37:53 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:48202 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965080AbeAJJhh (ORCPT ); Wed, 10 Jan 2018 04:37:37 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0A9b87g176720; Wed, 10 Jan 2018 09:37:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=uGG4Z8Nu44MR4CRI028Z1WIzatRwNVI+OoElp1GLcGI=; b=ugLRDh2rCpeirDf7OFTK2ljM0GZ+jLZMGAXubueDfTn9Jt15XMf4G+z1qzpmxfM12Jdy qRk3SKaVQXLGmF/315WwRCAR0r984tYL7TsmBveETr0eNsoU7L9j17XR2YXlDGzpAb1S 2LkoivPhGusS5jtsVWJ15rR3VXxb/Y9BCrq4vAkZt8l9tU5jDABRInidsF4oIJnazaYD MQhIs7veTelkZgn3KWayny5oHM+tfw3aTqPkPGKMexf0kclujwanMjp828gqJrAUhvEd Hv5cJoUA1BQm5Ki+Cj8r1J1m+FlfqXm7NhxmNYk9Koo+cbCTQjgEMz7qY+23cun9LbG6 9A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2fd8jn1828-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 10 Jan 2018 09:37:22 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0A9bL7A003928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Jan 2018 09:37:21 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0A9bJ5c027838; Wed, 10 Jan 2018 09:37:19 GMT Received: from mwanda (/41.202.241.23) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Jan 2018 01:37:18 -0800 Date: Wed, 10 Jan 2018 12:36:58 +0300 From: Dan Carpenter To: =?utf-8?Q?=C5=81ukasz?= Stelmach Cc: Matt Mackall , Herbert Xu , Arnd Bergmann , Greg Kroah-Hartman , Kukjin Kim , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-crypto@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] hwrng: exynos - Signedness bug in exynos_trng_do_read() Message-ID: <20180110093658.kxnmhqkoow7o2xab@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8769 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=738 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801100134 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP "val" needs to be signed for the error handling to work. Fixes: 6cd225cc5d8a ("hwrng: exynos - add Samsung Exynos True RNG driver") Signed-off-by: Dan Carpenter Reviewed-by: Krzysztof Kozlowski Acked-by: Ɓukasz Stelmach diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c index 34d6f51ecbee..f4643e3ec346 100644 --- a/drivers/char/hw_random/exynos-trng.c +++ b/drivers/char/hw_random/exynos-trng.c @@ -55,7 +55,7 @@ static int exynos_trng_do_read(struct hwrng *rng, void *data, size_t max, bool wait) { struct exynos_trng_dev *trng; - u32 val; + int val; max = min_t(size_t, max, (EXYNOS_TRNG_FIFO_LEN * 4));