Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbde4129 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723au: c2h_wk_callback(): Use GFP_KERNEL, and check return value



It is safe to use GFP_KERNEL in a workqueue handler, and check the
return value. If the malloc fails, skip and try again.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8282aeb6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1536,7 +1536,9 @@ static void c2h_wk_callback(struct work_struct *work)
			/* This C2H event is read, clear it */
			c2h_evt_clear23a(adapter);
		} else if ((c2h_evt = (struct c2h_evt_hdr *)
			    kmalloc(16, GFP_ATOMIC))) {
			    kmalloc(16, GFP_KERNEL))) {
			if (!c2h_evt)
				continue;
			/* This C2H event is not read, read & clear now */
			if (c2h_evt_read23a(adapter, (u8*)c2h_evt) != _SUCCESS)
				continue;