https://github.com/torvalds/linux
Revision 4739df6211911e6597602222b640e5c002563df6 authored by Himanshu Jha on 12 September 2017, 11:19:22 UTC, committed by David S. Miller on 15 September 2017, 21:02:05 UTC
call to memset to assign 0 value immediately after allocating
memory with kzalloc is unnecesaary as kzalloc allocates the memory
filled with 0 value.

Semantic patch used to resolve this issue:

@@
expression e,e2; constant c;
statement S;
@@

  e = kzalloc(e2, c);
  if(e == NULL) S
- memset(e, 0, e2);

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Acked-by: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 23f4822
Raw File
Tip revision: 4739df6211911e6597602222b640e5c002563df6 authored by Himanshu Jha on 12 September 2017, 11:19:22 UTC
qed: remove unnecessary call to memset
Tip revision: 4739df6
.gitignore
#
# Generated files
#
conmakehash
kallsyms
pnmtologo
unifdef
ihex2fw
recordmcount
check-lc_ctype
sortextable
asn1_compiler
extract-cert
sign-file
insert-sys-cert
back to top