|
From: Anders J. <and...@us...> - 2002-01-24 12:42:34
|
The following file was modified in linux/drivers/char/bluetooth:
Name Old version New version Comment
---- ----------- ----------- -------
btmem.c 1.45 1.46=20=20=20=20=20=20=20=20=20=20=20=20
The accompanying log:
* Check if allocation suceeded before trying to use it :).
The diff of the modified file(s):
--- btmem.c 2001/11/15 11:18:00 1.45
+++ btmem.c 2002/01/24 12:42:33 1.46
@@ -106,12 +106,17 @@
=20
/****************** FUNCTION DEFINITION SECTION **************************=
***/
=20
-void btmem_init(void)
+s32
+btmem_init(void)
{
/* Allocate memory area */
DSYS("Initialising BTMEM [%d bytes]\n", BT_BUF_SIZE);
=20
- bt_buf.head =3D (u8*) kmalloc(BT_BUF_SIZE,GFP_KERNEL);
+ if(!(bt_buf.head =3D (u8*) kmalloc(BT_BUF_SIZE,GFP_KERNEL))) {
+ D_ERR("Can't allocate BT memory buffers");
+ return -1;
+ }
+=09
=20=20=20
/* Initiate main buffer object */
bt_buf.tail =3D bt_buf.head + BT_BUF_SIZE;
|