Skip to content

Commit

Permalink
staging: tidspbridge: Remove NULL check before kfree
Browse files Browse the repository at this point in the history
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Ilia Mirkin authored and Greg Kroah-Hartman committed Mar 14, 2011
1 parent 39dd3e5 commit 9f7ff70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/tidspbridge/core/chnl_sm.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,7 @@ int bridge_chnl_open(struct chnl_object **chnl,
free_chirp_list(&pchnl->io_requests);
free_chirp_list(&pchnl->free_packets_list);

if (sync_event)
kfree(sync_event);
kfree(sync_event);

if (pchnl->ntfy_obj) {
ntfy_delete(pchnl->ntfy_obj);
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/tidspbridge/pmgr/dbll.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ void dbll_delete(struct dbll_tar_obj *target)
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(zl_target);

if (zl_target != NULL)
kfree(zl_target);
kfree(zl_target);

}

Expand Down

0 comments on commit 9f7ff70

Please sign in to comment.