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:	Thu, 19 Jul 2012 14:26:36 +0200
From:	Oliver Neukum <oliver@...kum.org>
To:	wei_wang@...lsil.com.cn
Cc:	gregkh@...uxfoundation.org, devel@...uxdriverproject.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] drivers/mmc/host: Add realtek sdmmc interface driver

On Thursday 19 July 2012 17:55:18 wei_wang@...lsil.com.cn wrote:

> +static void sd_normal_rw(struct realtek_sdmmc *host, struct mmc_request *mrq)
> +{
> +	struct mmc_command *cmd = mrq->cmd;
> +	struct mmc_data *data = mrq->data;
> +	u8 _cmd[5], *buf;
> +
> +	_cmd[0] = 0x40 | (u8)cmd->opcode;
> +	_cmd[1] = (u8)(cmd->arg >> 24);
> +	_cmd[2] = (u8)(cmd->arg >> 16);
> +	_cmd[3] = (u8)(cmd->arg >> 8);
> +	_cmd[4] = (u8)cmd->arg;

Please use the predefined macro for endianness conversion.

> +	buf = kzalloc(data->blksz, GFP_KERNEL);

1. You must handle a failure to allocate a buffer
2. You must use GFP_NOIO as you are in a block driver

	Regards
		Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ