From: Dan Carpenter Date: Tue, 11 Oct 2011 22:43:53 +0000 (-0400) Subject: cipso: remove an unneeded NULL check in cipso_v4_doi_add() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=56755924100261b8e52dca68ca53ece54b6f64ad;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git cipso: remove an unneeded NULL check in cipso_v4_doi_add() We dereference doi_def on the line before the NULL check. It has been this way since 2008. I checked all the callers and doi_def is always non-NULL here. Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller --- diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 2c2a98e402e7..86f3b885b4f3 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c @@ -476,7 +476,7 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def, doi = doi_def->doi; doi_type = doi_def->type; - if (doi_def == NULL || doi_def->doi == CIPSO_V4_DOI_UNKNOWN) + if (doi_def->doi == CIPSO_V4_DOI_UNKNOWN) goto doi_add_return; for (iter = 0; iter < CIPSO_V4_TAG_MAXCNT; iter++) { switch (doi_def->tags[iter]) {