Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ea75330 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] kfree cleanup: drivers/media



This is the drivers/media/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in drivers/media/.

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Cc: Johannes Stezenbach <js@linuxtv.org>
Cc: Michael Krufky <mkrufky@m1k.net>
Cc: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Acked-by : Manu Abraham <manu@linuxtv.org>
Acked-by: default avatarAndreas Oberritter <obi@linuxtv.org>
Acked-by: default avatarWilson Michaels <wilsonmichaels@earthlink.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 17fd682e
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -1331,9 +1331,7 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
{
	/* check if the ASIC is there */
	if (dst_probe(state) < 0) {
		if (state)
		kfree(state);

		return NULL;
	}
	/* determine settings based on type */
@@ -1349,9 +1347,7 @@ struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_ad
		break;
	default:
		dprintk(verbose, DST_ERROR, 1, "unknown DST type. please report to the LinuxTV.org DVB mailinglist.");
		if (state)
		kfree(state);

		return NULL;
	}

+2 −2
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ struct dvb_frontend* dvb_dummy_fe_qpsk_attach()
	return &state->frontend;

error:
	if (state) kfree(state);
	kfree(state);
	return NULL;
}

@@ -171,7 +171,7 @@ struct dvb_frontend* dvb_dummy_fe_qam_attach()
	return &state->frontend;

error:
	if (state) kfree(state);
	kfree(state);
	return NULL;
}

+2 −1
Original line number Diff line number Diff line
@@ -559,7 +559,8 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config,
	return &state->frontend;

error:
	if (reg0x3e >= 0) l64781_writereg (state, 0x3e, reg0x3e);  /* restore reg 0x3e */
	if (reg0x3e >= 0)
		l64781_writereg (state, 0x3e, reg0x3e);  /* restore reg 0x3e */
	kfree(state);
	return NULL;
}
+1 −2
Original line number Diff line number Diff line
@@ -731,7 +731,6 @@ struct dvb_frontend* lgdt330x_attach(const struct lgdt330x_config* config,
	return &state->frontend;

error:
	if (state)
	kfree(state);
	dprintk("%s: ERROR\n",__FUNCTION__);
	return NULL;
+1 −2
Original line number Diff line number Diff line
@@ -677,7 +677,6 @@ struct dvb_frontend* mt312_attach(const struct mt312_config* config,
	return &state->frontend;

error:
	if (state)
	kfree(state);
	return NULL;
}
Loading