Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp775250ybb; Sat, 28 Mar 2020 09:46:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtAEuAQnL/YmVT2OXReZ//Ee0sUzLz0roEotpSlDSJaslY7IUHgB87c+VhmGZVq4N3s1aEr X-Received: by 2002:aca:3089:: with SMTP id w131mr2902051oiw.121.1585413994220; Sat, 28 Mar 2020 09:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585413994; cv=none; d=google.com; s=arc-20160816; b=IzXdLiiGqFcFYdZvnM4aGz1n3quiZgQLqZUYgCr57Z0qdmzdUxIP02llFdC0zmFqPP v+ndDefWvO0cFMcsCAVlHtU3OtGISwi+2SHz8L/KL+9HVN49IsATtBc01t/XgkW1wrSW VP030ZCoIqIrfwPgVSMfA/NlOqUH2yIk80xarBvzSvTnYvw729F4DCSlH6R1BstXiAQS xs3uT2X4wXPKE2N26yjhFk/i/+cyerc708Xb4a3Ury3TJbCx0iEHAZ0MEaIobvfPVrz4 Bp7QFgPFw0enpDtfwnmGW6nd8OCbi6qPvA1U6jp7x1sSeTxNwntHDX5z5k1XUhZIjQo+ HsjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:message-id; bh=+UQR9f5J6/HYFgdsxPxadzHLwZa6P5IHSXmadUu9Y+c=; b=0kCx/AeXe+ZZRD3e7WfAJTFCtk7RzmFvxu3+AYcFO8w5rk+ezNGwiPRVfJD7xuUvV+ 5KyA5reyEuM1pkgmMEWYTTxcqcTWrv4FqOwVpH16Mml9QaqhZs66ECZ7GJr75T6/3Zne D8XqpYMxAHq8bSm4Yfk9iY84jAGiTYVuIDYv/BWdeQ6bkREZKaIcAe+4Luqdzmt5xfgb DwZiyzH4tk4DNjVvZRd7shk7XN3cVEV/ffqQRxbgzBFNs2DZPPGw8X/AKAMmGeO98cku NYLb1g4JE2CWT9a0B4wcHblpFen/VHE1taL3+f0Z6BwcLlaBkilWpl/6ZpW6WuZh6p1H pIIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si4087478oop.3.2020.03.28.09.46.21; Sat, 28 Mar 2020 09:46:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728100AbgC1QpX (ORCPT + 99 others); Sat, 28 Mar 2020 12:45:23 -0400 Received: from mx.sdf.org ([205.166.94.20]:49978 "EHLO mx.sdf.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727779AbgC1Qnl (ORCPT ); Sat, 28 Mar 2020 12:43:41 -0400 Received: from sdf.org (IDENT:lkml@sdf.lonestar.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 02SGhOjk028101 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Sat, 28 Mar 2020 16:43:24 GMT Received: (from lkml@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 02SGhN8L003837; Sat, 28 Mar 2020 16:43:23 GMT Message-Id: <202003281643.02SGhN8L003837@sdf.org> From: George Spelvin Date: Wed, 21 Aug 2019 20:15:22 -0400 Subject: [RFC PATCH v1 43/50] drivers/isdn: Use get_random_u32() To: linux-kernel@vger.kernel.org, lkml@sdf.org Cc: Karsten Keil , isdn4linux@listserv.isdn4linux.de, netdev@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There's no need to get_random_bytes() into a temporary buffer. This is not a no-brainer change; get_random_u32() has slightly weaker security guarantees, but they're fine for applications like these where the random value is stored in the kernel for as long as it's valuable. Signed-off-by: George Spelvin Cc: Karsten Keil Cc: isdn4linux@listserv.isdn4linux.de Cc: netdev@vger.kernel.org --- drivers/isdn/mISDN/tei.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/isdn/mISDN/tei.c b/drivers/isdn/mISDN/tei.c index 59d28cb19738e..8135e20a667cc 100644 --- a/drivers/isdn/mISDN/tei.c +++ b/drivers/isdn/mISDN/tei.c @@ -404,10 +404,7 @@ dl_unit_data(struct manager *mgr, struct sk_buff *skb) static unsigned int random_ri(void) { - u16 x; - - get_random_bytes(&x, sizeof(x)); - return x; + return get_random_u32() & 0xffff; } static struct layer2 * -- 2.26.0