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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 29 Jul 2016 13:48:02 +0100
From:	One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
To:	"Ji-Ze Hong (Peter Hong)" <hpeter@...il.com>
Cc:	johan@...nel.org, gregkh@...uxfoundation.org,
	tom_tsai@...tek.com.tw, peter_hong@...tek.com.tw,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Ji-Ze Hong (Peter Hong)" <hpeter+linux_kernel@...il.com>
Subject: Re: [PATCH] usb:serial: Add Fintek F81532/534 driver

O
> +static int f81534_set_normal_register(struct usb_device *dev, u16 reg, u8 data)
> +{
> +	size_t count = F81534_USB_MAX_RETRY;
> +	int status;
> +	u8 *tmp;
> +
> +	tmp = kmalloc(sizeof(u8), GFP_KERNEL);
> +	if (!tmp)
> +		return -ENOMEM;

You end up doing huge numbers of tiny allocation and frees in some of the
code paths. I think it would be better to allocate them at a higher level
as they are not that cheap on CPU time.

> +static int f81534_read_data(struct usb_serial *usbserial, u32 address,
> +				size_t size, unsigned char *buf)
> +{

Is a particularly good example - you do 4 mallocs plus two per byte of
data.

Alan

Powered by blists - more mailing lists