diff options
author | 2013-03-02 12:50:01 +0000 | |
---|---|---|
committer | 2013-03-02 12:50:01 +0000 | |
commit | 70bf54cecd13fa611a7feb0e989c4756e21e8e70 (patch) | |
tree | b1c54192b7db6396d371452a4243ac7e1b68fa86 | |
parent | When a PF rule contains 'set tos' *followed by* a scrub option, the tos (diff) | |
download | wireguard-openbsd-70bf54cecd13fa611a7feb0e989c4756e21e8e70.tar.xz wireguard-openbsd-70bf54cecd13fa611a7feb0e989c4756e21e8e70.zip |
sr_alloc_resources() and sr_free_resources() can never be called without
a valid struct sr_discipline. Remove redundant NULL pointer checks.
-rw-r--r-- | sys/dev/softraid_aoe.c | 14 | ||||
-rw-r--r-- | sys/dev/softraid_concat.c | 9 | ||||
-rw-r--r-- | sys/dev/softraid_crypto.c | 8 | ||||
-rw-r--r-- | sys/dev/softraid_raid0.c | 8 | ||||
-rw-r--r-- | sys/dev/softraid_raid1.c | 8 | ||||
-rw-r--r-- | sys/dev/softraid_raid6.c | 8 | ||||
-rw-r--r-- | sys/dev/softraid_raidp.c | 8 |
7 files changed, 7 insertions, 56 deletions
diff --git a/sys/dev/softraid_aoe.c b/sys/dev/softraid_aoe.c index f2cab3dc29c..6134edaed61 100644 --- a/sys/dev/softraid_aoe.c +++ b/sys/dev/softraid_aoe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_aoe.c,v 1.29 2013/01/16 06:42:22 jsing Exp $ */ +/* $OpenBSD: softraid_aoe.c,v 1.30 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2008 Ted Unangst <tedu@openbsd.org> * Copyright (c) 2008 Marco Peereboom <marco@openbsd.org> @@ -243,9 +243,6 @@ out: int sr_aoe_alloc_resources(struct sr_discipline *sd) { - if (!sd) - return (EINVAL); - DNPRINTF(SR_D_DIS, "%s: sr_aoe_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -261,9 +258,6 @@ sr_aoe_free_resources(struct sr_discipline *sd) int s, rv = EINVAL; struct aoe_handler *ah; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_aoe_free_resources\n", DEVNAME(sd->sd_sc)); @@ -604,9 +598,6 @@ sr_aoe_server_alloc_resources(struct sr_discipline *sd) struct aoe_handler *ah; struct ifnet *ifp; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_aoe_server_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -655,9 +646,6 @@ sr_aoe_server_free_resources(struct sr_discipline *sd) { int s; - if (!sd) - return (EINVAL); - DNPRINTF(SR_D_DIS, "%s: sr_aoe_server_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_concat.c b/sys/dev/softraid_concat.c index 66f40cf3f34..0242954503a 100644 --- a/sys/dev/softraid_concat.c +++ b/sys/dev/softraid_concat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_concat.c,v 1.10 2013/03/02 12:25:55 jsing Exp $ */ +/* $OpenBSD: softraid_concat.c,v 1.11 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2011 Joel Sing <jsing@openbsd.org> @@ -85,7 +85,6 @@ int sr_concat_assemble(struct sr_discipline *sd, struct bioc_createraid *bc, int no_chunk, void *data) { - sd->sd_max_ccb_per_wu = SR_CONCAT_NOWU * no_chunk; return 0; @@ -96,9 +95,6 @@ sr_concat_alloc_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_concat_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -117,9 +113,6 @@ sr_concat_free_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_concat_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c index 5fa357ef2bc..bae844b6857 100644 --- a/sys/dev/softraid_crypto.c +++ b/sys/dev/softraid_crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_crypto.c,v 1.86 2013/01/18 23:22:18 jsing Exp $ */ +/* $OpenBSD: softraid_crypto.c,v 1.87 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org> @@ -960,9 +960,6 @@ sr_crypto_alloc_resources(struct sr_discipline *sd) struct sr_crypto_wu *crwu; u_int num_keys, i; - if (!sd) - return (EINVAL); - DNPRINTF(SR_D_DIS, "%s: sr_crypto_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -1054,9 +1051,6 @@ sr_crypto_free_resources(struct sr_discipline *sd) struct sr_crypto_wu *crwu; u_int i; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_crypto_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_raid0.c b/sys/dev/softraid_raid0.c index 5c85b87b068..4b83d6c63e5 100644 --- a/sys/dev/softraid_raid0.c +++ b/sys/dev/softraid_raid0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid0.c,v 1.34 2013/03/02 12:25:55 jsing Exp $ */ +/* $OpenBSD: softraid_raid0.c,v 1.35 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2008 Marco Peereboom <marco@peereboom.us> * @@ -114,9 +114,6 @@ sr_raid0_alloc_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid0_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -141,9 +138,6 @@ sr_raid0_free_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid0_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_raid1.c b/sys/dev/softraid_raid1.c index 14d0f39fd7e..9d74a0109d4 100644 --- a/sys/dev/softraid_raid1.c +++ b/sys/dev/softraid_raid1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid1.c,v 1.40 2013/01/18 05:59:28 jsing Exp $ */ +/* $OpenBSD: softraid_raid1.c,v 1.41 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2007 Marco Peereboom <marco@peereboom.us> * @@ -110,9 +110,6 @@ sr_raid1_alloc_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid1_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -131,9 +128,6 @@ sr_raid1_free_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid1_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_raid6.c b/sys/dev/softraid_raid6.c index a99c53f8731..85a68e1be2a 100644 --- a/sys/dev/softraid_raid6.c +++ b/sys/dev/softraid_raid6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raid6.c,v 1.33 2013/01/16 09:21:50 jsing Exp $ */ +/* $OpenBSD: softraid_raid6.c,v 1.34 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org> @@ -161,9 +161,6 @@ sr_raid6_alloc_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid6_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -188,9 +185,6 @@ sr_raid6_free_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raid6_free_resources\n", DEVNAME(sd->sd_sc)); diff --git a/sys/dev/softraid_raidp.c b/sys/dev/softraid_raidp.c index 94e59d056f9..6f65e97dfc6 100644 --- a/sys/dev/softraid_raidp.c +++ b/sys/dev/softraid_raidp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: softraid_raidp.c,v 1.30 2013/01/16 09:21:50 jsing Exp $ */ +/* $OpenBSD: softraid_raidp.c,v 1.31 2013/03/02 12:50:01 jsing Exp $ */ /* * Copyright (c) 2009 Marco Peereboom <marco@peereboom.us> * Copyright (c) 2009 Jordan Hargrave <jordan@openbsd.org> @@ -133,9 +133,6 @@ sr_raidp_alloc_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raidp_alloc_resources\n", DEVNAME(sd->sd_sc)); @@ -160,9 +157,6 @@ sr_raidp_free_resources(struct sr_discipline *sd) { int rv = EINVAL; - if (!sd) - return (rv); - DNPRINTF(SR_D_DIS, "%s: sr_raidp_free_resources\n", DEVNAME(sd->sd_sc)); |