lkml.org 
[lkml]   [2013]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 12/16] staging: usbip: Pass session keys to the kernel
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


\
 
 \ /
  Last update: 2013-10-25 18:01    [W:0.938 / U:1.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site