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:	Mon, 9 Feb 2015 11:05:24 +0100
From:	Bas Peters <baspeters93@...il.com>
To:	Peter Chen <peter.chen@...escale.com>
Cc:	gregkh@...uxgoundation.org, Alan Stern <stern@...land.harvard.edu>,
	dan.j.williams@...el.com, hdegoede@...hat.com,
	sarah.a.sharp@...ux.intel.com, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/6] drivers: usb: core: devio.c: remove assignment of
 variables in if conditions.

2015-02-09 3:15 GMT+01:00 Peter Chen <peter.chen@...escale.com>:
> On Sat, Feb 07, 2015 at 10:55:01PM +0100, Bas Peters wrote:
>> This patch removes assignment of variables in if conditions in
>> accordance witht the CodingStyle.
>
> %s/witht/with

Typo, my bad. Should I fix the commit message and resend?

>
>>
>> Signed-off-by: Bas Peters <baspeters93@...il.com>
>> ---
>>  drivers/usb/core/devio.c | 15 ++++++++++-----
>>  1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
>> index 0b59731..ea3c737 100644
>> --- a/drivers/usb/core/devio.c
>> +++ b/drivers/usb/core/devio.c
>> @@ -1081,7 +1081,8 @@ static int proc_bulk(struct usb_dev_state *ps, void __user *arg)
>>       ret = usbfs_increase_memory_usage(len1 + sizeof(struct urb));
>>       if (ret)
>>               return ret;
>> -     if (!(tbuf = kmalloc(len1, GFP_KERNEL))) {
>> +     tbuf = kmalloc(len1, GFP_KERNEL);
>> +     if (!tbuf) {
>>               ret = -ENOMEM;
>>               goto done;
>>       }
>> @@ -1223,7 +1224,8 @@ static int proc_setintf(struct usb_dev_state *ps, void __user *arg)
>>
>>       if (copy_from_user(&setintf, arg, sizeof(setintf)))
>>               return -EFAULT;
>> -     if ((ret = checkintf(ps, setintf.interface)))
>> +     ret = checkintf(ps, setintf.interface);
>> +     if (ret)
>>               return ret;
>>
>>       destroy_async_on_interface(ps, setintf.interface);
>> @@ -1392,7 +1394,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb
>>               number_of_packets = uurb->number_of_packets;
>>               isofrmlen = sizeof(struct usbdevfs_iso_packet_desc) *
>>                                  number_of_packets;
>> -             if (!(isopkt = kmalloc(isofrmlen, GFP_KERNEL)))
>> +             isopkt = kmalloc(isofrmlen, GFP_KERNEL);
>> +             if (!isopkt)
>>                       return -ENOMEM;
>>               if (copy_from_user(isopkt, iso_frame_desc, isofrmlen)) {
>>                       ret = -EFAULT;
>> @@ -1901,7 +1904,8 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg)
>>
>>       if (get_user(ifnum, (unsigned int __user *)arg))
>>               return -EFAULT;
>> -     if ((ret = releaseintf(ps, ifnum)) < 0)
>> +     ret = releaseintf(ps, ifnum);
>> +     if (ret < 0)
>>               return ret;
>>       destroy_async_on_interface (ps, ifnum);
>>       return 0;
>> @@ -1916,7 +1920,8 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl)
>>       struct usb_driver       *driver = NULL;
>>
>>       /* alloc buffer */
>> -     if ((size = _IOC_SIZE(ctl->ioctl_code)) > 0) {
>> +     size = _IOC_SIZE(ctl->ioctl_code);
>> +     if (size > 0) {
>>               buf = kmalloc(size, GFP_KERNEL);
>>               if (buf == NULL)
>>                       return -ENOMEM;
>> --
>> 2.1.0
>>
>
> --
>
> Best Regards,
> Peter Chen
--
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