Skip to content

Commit

Permalink
staging: tidspbridge: check return code of kzalloc
Browse files Browse the repository at this point in the history
Function kzalloc may fail. Check for it.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent d5ed543 commit e5a7dc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/staging/tidspbridge/rmgr/dbdcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ int dcd_get_object_def(struct dcd_manager *hdcd_mgr,

/* Allocate zeroed buffer. */
psz_coff_buf = kzalloc(ul_len + 4, GFP_KERNEL);
if (psz_coff_buf == NULL) {
status = -ENOMEM;
goto func_end;
}
#ifdef _DB_TIOMAP
if (strstr(dcd_key->path, "iva") == NULL) {
/* Locate section by objectID and read its content. */
Expand Down Expand Up @@ -571,6 +575,10 @@ int dcd_get_objects(struct dcd_manager *hdcd_mgr,

/* Allocate zeroed buffer. */
psz_coff_buf = kzalloc(ul_len + 4, GFP_KERNEL);
if (psz_coff_buf == NULL) {
status = -ENOMEM;
goto func_cont;
}
#ifdef _DB_TIOMAP
if (strstr(sz_coff_path, "iva") == NULL) {
/* Locate section by objectID and read its content. */
Expand Down

0 comments on commit e5a7dc5

Please sign in to comment.