Skip to content

Commit

Permalink
Revert some changes that seldom lead to a hard freeze (until I figure…
Browse files Browse the repository at this point in the history
… out what's wrong).
  • Loading branch information
evilynux committed May 20, 2021
1 parent b0b079d commit cb2de3c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions hid-ghlive/src/hid-ghlive.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,22 @@ static void ghl_magic_poke(struct timer_list *t)
ARRAY_SIZE(ghl_ps3wiiu_magic_data);
unsigned int pipe = usb_sndctrlpipe(usbdev, 0);

if(!sc->cr) {
sc->cr = kzalloc(sizeof(*sc->cr), GFP_ATOMIC);
if (!sc->cr)
goto resched;
}
sc->cr = kzalloc(sizeof(*sc->cr), GFP_ATOMIC);
if (!sc->cr)
goto resched;

if(!sc->databuf) {
sc->databuf = kzalloc(poke_size, GFP_ATOMIC);
if (!sc->databuf)
goto resched;
sc->databuf = kzalloc(poke_size, GFP_ATOMIC);
if (!sc->databuf) {
kfree(sc->cr);
goto resched;
}

urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb)
if (!urb) {
kfree(sc->databuf);
kfree(sc->cr);
goto resched;
}

sc->cr->bRequestType =
USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT;
Expand Down

0 comments on commit cb2de3c

Please sign in to comment.