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

Commit 8f760780 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] Remove redundant NULL checks before [kv]free - in drivers/



Remove redundant NULL chck before kfree + tiny CodingStyle cleanup for
drivers/

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9a66a53f
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -329,7 +329,6 @@ static int __devinit agp_sgi_init(void)

static void __devexit agp_sgi_cleanup(void)
{
	if (sgi_tioca_agp_bridges)
	kfree(sgi_tioca_agp_bridges);
	sgi_tioca_agp_bridges = NULL;
}
+5 −6
Original line number Diff line number Diff line
@@ -1320,6 +1320,7 @@ static struct tty_operations hvcs_ops = {
static int hvcs_alloc_index_list(int n)
{
	int i;

	hvcs_index_list = kmalloc(n * sizeof(hvcs_index_count),GFP_KERNEL);
	if (!hvcs_index_list)
		return -ENOMEM;
@@ -1332,12 +1333,10 @@ static int hvcs_alloc_index_list(int n)
static void hvcs_free_index_list(void)
{
	/* Paranoia check to be thorough. */
	if (hvcs_index_list) {
	kfree(hvcs_index_list);
	hvcs_index_list = NULL;
	hvcs_index_count = 0;
}
}

static int __init hvcs_module_init(void)
{
+2 −4
Original line number Diff line number Diff line
@@ -305,9 +305,7 @@ mptfc_GetFcDevPage0(MPT_ADAPTER *ioc, int ioc_port,
	}

 out:
	if (pp0_array)
	kfree(pp0_array);
	if (p0_array)
	kfree(p0_array);
	return rc;
}
+1 −2
Original line number Diff line number Diff line
@@ -1378,7 +1378,6 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
	return 0;

 out_free_port_info:
	if (hba)
	kfree(hba);
 out:
	return error;
+1 −2
Original line number Diff line number Diff line
@@ -431,7 +431,6 @@ static struct fs_enet_mii_bus *create_bus(const struct fs_mii_bus_info *bi)
	return bus;

err:
	if (bus)
	kfree(bus);
	return ERR_PTR(ret);
}
Loading