From owner-svn-src-all@freebsd.org Wed Jan 10 20:50:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59E5EE7622A; Wed, 10 Jan 2018 20:50:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34D566BD0C; Wed, 10 Jan 2018 20:50:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 761062B51; Wed, 10 Jan 2018 20:50:06 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0AKo6ia009156; Wed, 10 Jan 2018 20:50:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0AKo65b009155; Wed, 10 Jan 2018 20:50:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201801102050.w0AKo65b009155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 10 Jan 2018 20:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327788 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 327788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jan 2018 20:50:07 -0000 Author: pfg Date: Wed Jan 10 20:50:06 2018 New Revision: 327788 URL: https://svnweb.freebsd.org/changeset/base/327788 Log: linuxkpi: Simplify kmalloc_array. kmalloc_array seems what we call mallocarray(9). Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:49:01 2018 (r327787) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jan 10 20:50:06 2018 (r327788) @@ -121,9 +121,7 @@ vmalloc_32(size_t size) static inline void * kmalloc_array(size_t n, size_t size, gfp_t flags) { - if (size != 0 && n > (SIZE_MAX / size)) - return (NULL); - return (malloc(n * size, M_KMALLOC, linux_check_m_flags(flags))); + return (mallocarray(n, size, M_KMALLOC, linux_check_m_flags(flags))); } static inline void *