Re: [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel

From: Dan Carpenter
Date: Fri Oct 25 2013 - 11:04:46 EST


On Sat, Oct 19, 2013 at 04:39:15PM +0200, Dominik Paulus wrote:
> @@ -367,10 +367,17 @@ int usbip_host_export_device(struct usbip_exported_device *edev,
> return -1;
> }
>
> - snprintf(sockfd_buff, sizeof(sockfd_buff), "%d\n", conf->sockfd);
> - dbg("write: %s", sockfd_buff);
> + {
> + char key1[33], key2[33];
> + snprintf(sockfd_buff, sizeof(sockfd_buff), "%d %d %s %s\n",
> + conf->sockfd, conf->use_crypto,
> + keytohex(conf->key2, key2),
> + keytohex(conf->key1, key1));
> + dbg("write: %s", sockfd_buff);
> + }

This is gross. Don't do that. My gut says to just delete the debug
code but I hate debug code by default.

> - ret = sysfs_write_attribute(attr, sockfd_buff, strlen(sockfd_buff));
> + ret = sysfs_write_attribute(attr, (const char *) sockfd_buff,

Don't put a space between the cast and the variable.

ret = sysfs_write_attribute(attr, (const char *)sockfd_buff,

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