Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285177
b: refs/heads/master
c: ff17999
h: refs/heads/master
i:
  285175: 58df616
v: v3
  • Loading branch information
Josh Boyer authored and Mauro Carvalho Chehab committed Nov 7, 2011
1 parent e202ab2 commit 82b9570
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b3c13ecce3bc0fbdeb5ef0596b350dc702d01d5
refs/heads/master: ff17999184ed13829bc14c3be412d980173dff40
17 changes: 15 additions & 2 deletions trunk/drivers/media/dvb/dvb-usb/ttusb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,18 @@ static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd,
u8 *wbuf, int wlen, u8 *rbuf, int rlen)
{
struct ttusb2_state *st = d->priv;
u8 s[wlen+4],r[64] = { 0 };
u8 *s, *r = NULL;
int ret = 0;

memset(s,0,wlen+4);
s = kzalloc(wlen+4, GFP_KERNEL);
if (!s)
return -ENOMEM;

r = kzalloc(64, GFP_KERNEL);
if (!r) {
kfree(s);
return -ENOMEM;
}

s[0] = 0xaa;
s[1] = ++st->id;
Expand All @@ -94,12 +102,17 @@ static int ttusb2_msg(struct dvb_usb_device *d, u8 cmd,
r[2] != cmd ||
(rlen > 0 && r[3] != rlen)) {
warn("there might have been an error during control message transfer. (rlen = %d, was %d)",rlen,r[3]);
kfree(s);
kfree(r);
return -EIO;
}

if (rlen > 0)
memcpy(rbuf, &r[4], rlen);

kfree(s);
kfree(r);

return 0;
}

Expand Down

0 comments on commit 82b9570

Please sign in to comment.