Re: [kbuild] [PATCH] usb: sierra: fix a missing check of device_create_file

From: Dan Carpenter
Date: Tue Mar 26 2019 - 04:23:47 EST


On Tue, Mar 26, 2019 at 11:18:31AM +0300, Dan Carpenter wrote:
> 32fe5e393 Kevin Lloyd 2008-07-10 193 }
> 32fe5e393 Kevin Lloyd 2008-07-10 194 kfree(swocInfo);
> ^^^^^^^^^^^^^^^^
>
> 32fe5e393 Kevin Lloyd 2008-07-10 195 }
>
> break statement?

Sorry, for some reason I saw "complete:" and read "default:". :/

But the warning seems valid.

regards,
dan carpenter

>
> 32fe5e393 Kevin Lloyd 2008-07-10 196 complete:
> 32fe5e393 Kevin Lloyd 2008-07-10 197 result = device_create_file(&us->pusb_intf->dev, &dev_attr_truinst);
> 04d66f3d0 Kangjie Lu 2019-03-24 198 if (result) {
> 04d66f3d0 Kangjie Lu 2019-03-24 @199 kfree(swocInfo);
> ^^^^^^^^^^^^^^^
> Double free.
>