Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: remove the unnecessary check in cipso_v4_doi_free

The commit 733c99ee8be9 ("net: fix NULL pointer reference in
cipso_v4_doi_free") was merged by a mistake, this patch try
to cleanup the mess.

And we already have the commit e842cb60e8ac ("net: fix NULL
pointer reference in cipso_v4_doi_free") which fixed the root
cause of the issue mentioned in it's description.

Suggested-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Michael Wang <yun.wang@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

王贇 and committed by
David S. Miller
9756e44f ddd0d529

+8 -10
+8 -10
net/ipv4/cipso_ipv4.c
··· 465 465 if (!doi_def) 466 466 return; 467 467 468 - if (doi_def->map.std) { 469 - switch (doi_def->type) { 470 - case CIPSO_V4_MAP_TRANS: 471 - kfree(doi_def->map.std->lvl.cipso); 472 - kfree(doi_def->map.std->lvl.local); 473 - kfree(doi_def->map.std->cat.cipso); 474 - kfree(doi_def->map.std->cat.local); 475 - kfree(doi_def->map.std); 476 - break; 477 - } 468 + switch (doi_def->type) { 469 + case CIPSO_V4_MAP_TRANS: 470 + kfree(doi_def->map.std->lvl.cipso); 471 + kfree(doi_def->map.std->lvl.local); 472 + kfree(doi_def->map.std->cat.cipso); 473 + kfree(doi_def->map.std->cat.local); 474 + kfree(doi_def->map.std); 475 + break; 478 476 } 479 477 kfree(doi_def); 480 478 }