mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-12 12:22:42 +00:00
staging: gdm724x: cleanup alloc_tx_sdu_struct()
The kfree(t_sdu->buf) sets off a private static checker warning because "t_sdu->buf" is always NULL. This function just allocates two pointers so we can re-write it to be simpler. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a469fe1ab8
commit
75bc5fad15
@ -119,28 +119,15 @@ out:
|
||||
|
||||
static struct usb_tx_sdu *alloc_tx_sdu_struct(void)
|
||||
{
|
||||
struct usb_tx_sdu *t_sdu = NULL;
|
||||
int ret = 0;
|
||||
|
||||
struct usb_tx_sdu *t_sdu;
|
||||
|
||||
t_sdu = kzalloc(sizeof(struct usb_tx_sdu), GFP_ATOMIC);
|
||||
if (!t_sdu) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
if (!t_sdu)
|
||||
return NULL;
|
||||
|
||||
t_sdu->buf = kmalloc(SDU_BUF_SIZE, GFP_ATOMIC);
|
||||
if (!t_sdu->buf) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
out:
|
||||
|
||||
if (ret < 0) {
|
||||
if (t_sdu) {
|
||||
kfree(t_sdu->buf);
|
||||
kfree(t_sdu);
|
||||
}
|
||||
kfree(t_sdu);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user