Skip to content

Commit

Permalink
staging: speakup: 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 ef055f1 commit 39dd3e5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/speakup/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,10 +1305,8 @@ void speakup_deallocate(struct vc_data *vc)
int vc_num;

vc_num = vc->vc_num;
if (speakup_console[vc_num] != NULL) {
kfree(speakup_console[vc_num]);
speakup_console[vc_num] = NULL;
}
kfree(speakup_console[vc_num]);
speakup_console[vc_num] = NULL;
}

static u_char is_cursor;
Expand Down

0 comments on commit 39dd3e5

Please sign in to comment.