Commit 7ad90975 authored by Chris Wright's avatar Chris Wright Committed by Linus Torvalds

[PATCH] Use NULL instead of integer 0 in security/selinux/

Fixup another round of sparse warnings of the type:
	warning: Using plain integer as NULL pointer
Acked by Stephen.

From: Mika Kukkonen <mika@osdl.org>
Signed-off-by: default avatarChris Wright <chrisw@osdl.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5476dbd6
...@@ -106,7 +106,7 @@ static inline void avc_cache_stats_add(int type, unsigned val) ...@@ -106,7 +106,7 @@ static inline void avc_cache_stats_add(int type, unsigned val)
*/ */
void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av) void avc_dump_av(struct audit_buffer *ab, u16 tclass, u32 av)
{ {
char **common_pts = 0; char **common_pts = NULL;
u32 common_base = 0; u32 common_base = 0;
int i, i2, perm; int i, i2, perm;
...@@ -734,7 +734,7 @@ static int avc_update_cache(u32 event, u32 ssid, u32 tsid, ...@@ -734,7 +734,7 @@ static int avc_update_cache(u32 event, u32 ssid, u32 tsid,
} }
} else { } else {
/* apply to one node */ /* apply to one node */
node = avc_search_node(ssid, tsid, tclass, 0); node = avc_search_node(ssid, tsid, tclass, NULL);
if (node) { if (node) {
avc_update_node(event,node,perms); avc_update_node(event,node,perms);
} }
...@@ -808,7 +808,7 @@ int avc_ss_grant(u32 ssid, u32 tsid, u16 tclass, ...@@ -808,7 +808,7 @@ int avc_ss_grant(u32 ssid, u32 tsid, u16 tclass,
u32 perms, u32 seqno) u32 perms, u32 seqno)
{ {
return avc_control(AVC_CALLBACK_GRANT, return avc_control(AVC_CALLBACK_GRANT,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
} }
/** /**
...@@ -846,7 +846,7 @@ int avc_ss_revoke(u32 ssid, u32 tsid, u16 tclass, ...@@ -846,7 +846,7 @@ int avc_ss_revoke(u32 ssid, u32 tsid, u16 tclass,
u32 perms, u32 seqno) u32 perms, u32 seqno)
{ {
return avc_control(AVC_CALLBACK_REVOKE, return avc_control(AVC_CALLBACK_REVOKE,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
} }
/** /**
...@@ -878,7 +878,7 @@ int avc_ss_reset(u32 seqno) ...@@ -878,7 +878,7 @@ int avc_ss_reset(u32 seqno)
avc_node_freelist = tmp; avc_node_freelist = tmp;
avc_cache.active_nodes--; avc_cache.active_nodes--;
} }
avc_cache.slots[i] = 0; avc_cache.slots[i] = NULL;
} }
avc_cache.lru_hint = 0; avc_cache.lru_hint = 0;
...@@ -890,7 +890,7 @@ int avc_ss_reset(u32 seqno) ...@@ -890,7 +890,7 @@ int avc_ss_reset(u32 seqno)
for (c = avc_callbacks; c; c = c->next) { for (c = avc_callbacks; c; c = c->next) {
if (c->events & AVC_CALLBACK_RESET) { if (c->events & AVC_CALLBACK_RESET) {
rc = c->callback(AVC_CALLBACK_RESET, rc = c->callback(AVC_CALLBACK_RESET,
0, 0, 0, 0, 0); 0, 0, 0, 0, NULL);
if (rc) if (rc)
goto out; goto out;
} }
...@@ -918,10 +918,10 @@ int avc_ss_set_auditallow(u32 ssid, u32 tsid, u16 tclass, ...@@ -918,10 +918,10 @@ int avc_ss_set_auditallow(u32 ssid, u32 tsid, u16 tclass,
{ {
if (enable) if (enable)
return avc_control(AVC_CALLBACK_AUDITALLOW_ENABLE, return avc_control(AVC_CALLBACK_AUDITALLOW_ENABLE,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
else else
return avc_control(AVC_CALLBACK_AUDITALLOW_DISABLE, return avc_control(AVC_CALLBACK_AUDITALLOW_DISABLE,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
} }
/** /**
...@@ -938,10 +938,10 @@ int avc_ss_set_auditdeny(u32 ssid, u32 tsid, u16 tclass, ...@@ -938,10 +938,10 @@ int avc_ss_set_auditdeny(u32 ssid, u32 tsid, u16 tclass,
{ {
if (enable) if (enable)
return avc_control(AVC_CALLBACK_AUDITDENY_ENABLE, return avc_control(AVC_CALLBACK_AUDITDENY_ENABLE,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
else else
return avc_control(AVC_CALLBACK_AUDITDENY_DISABLE, return avc_control(AVC_CALLBACK_AUDITDENY_DISABLE,
ssid, tsid, tclass, perms, seqno, 0); ssid, tsid, tclass, perms, seqno, NULL);
} }
/** /**
...@@ -993,7 +993,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid, ...@@ -993,7 +993,7 @@ int avc_has_perm_noaudit(u32 ssid, u32 tsid,
ae->used = 1; ae->used = 1;
} else { } else {
avc_cache_stats_incr(AVC_ENTRY_DISCARDS); avc_cache_stats_incr(AVC_ENTRY_DISCARDS);
ae = 0; ae = NULL;
} }
} }
......
...@@ -217,7 +217,7 @@ int bool_isvalid(struct cond_bool_datum *b) ...@@ -217,7 +217,7 @@ int bool_isvalid(struct cond_bool_datum *b)
int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp) int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct cond_bool_datum *booldatum; struct cond_bool_datum *booldatum;
__u32 *buf, len; __u32 *buf, len;
...@@ -251,7 +251,7 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp) ...@@ -251,7 +251,7 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
return 0; return 0;
err: err:
cond_destroy_bool(key, booldatum, 0); cond_destroy_bool(key, booldatum, NULL);
return -1; return -1;
} }
......
...@@ -17,7 +17,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2) ...@@ -17,7 +17,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2)
n1 = e1->node; n1 = e1->node;
n2 = e2->node; n2 = e2->node;
prev = 0; prev = NULL;
while (n1 || n2) { while (n1 || n2) {
new = kmalloc(sizeof(*new), GFP_ATOMIC); new = kmalloc(sizeof(*new), GFP_ATOMIC);
if (!new) { if (!new) {
...@@ -40,7 +40,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2) ...@@ -40,7 +40,7 @@ int ebitmap_or(struct ebitmap *dst, struct ebitmap *e1, struct ebitmap *e2)
n2 = n2->next; n2 = n2->next;
} }
new->next = 0; new->next = NULL;
if (prev) if (prev)
prev->next = new; prev->next = new;
else else
...@@ -80,7 +80,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src) ...@@ -80,7 +80,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src)
ebitmap_init(dst); ebitmap_init(dst);
n = src->node; n = src->node;
prev = 0; prev = NULL;
while (n) { while (n) {
new = kmalloc(sizeof(*new), GFP_ATOMIC); new = kmalloc(sizeof(*new), GFP_ATOMIC);
if (!new) { if (!new) {
...@@ -90,7 +90,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src) ...@@ -90,7 +90,7 @@ int ebitmap_cpy(struct ebitmap *dst, struct ebitmap *src)
memset(new, 0, sizeof(*new)); memset(new, 0, sizeof(*new));
new->startbit = n->startbit; new->startbit = n->startbit;
new->map = n->map; new->map = n->map;
new->next = 0; new->next = NULL;
if (prev) if (prev)
prev->next = new; prev->next = new;
else else
...@@ -155,7 +155,7 @@ int ebitmap_set_bit(struct ebitmap *e, unsigned long bit, int value) ...@@ -155,7 +155,7 @@ int ebitmap_set_bit(struct ebitmap *e, unsigned long bit, int value)
{ {
struct ebitmap_node *n, *prev, *new; struct ebitmap_node *n, *prev, *new;
prev = 0; prev = NULL;
n = e->node; n = e->node;
while (n && n->startbit <= bit) { while (n && n->startbit <= bit) {
if ((n->startbit + MAPSIZE) > bit) { if ((n->startbit + MAPSIZE) > bit) {
...@@ -231,7 +231,7 @@ void ebitmap_destroy(struct ebitmap *e) ...@@ -231,7 +231,7 @@ void ebitmap_destroy(struct ebitmap *e)
} }
e->highbit = 0; e->highbit = 0;
e->node = 0; e->node = NULL;
return; return;
} }
......
...@@ -654,7 +654,7 @@ int cat_destroy(void *key, void *datum, void *p) ...@@ -654,7 +654,7 @@ int cat_destroy(void *key, void *datum, void *p)
int sens_read(struct policydb *p, struct hashtab *h, void *fp) int sens_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct level_datum *levdatum; struct level_datum *levdatum;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
...@@ -707,7 +707,7 @@ int sens_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -707,7 +707,7 @@ int sens_read(struct policydb *p, struct hashtab *h, void *fp)
int cat_read(struct policydb *p, struct hashtab *h, void *fp) int cat_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct cat_datum *catdatum; struct cat_datum *catdatum;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
......
...@@ -99,7 +99,7 @@ static struct policydb_compat_info *policydb_lookup_compat(int version) ...@@ -99,7 +99,7 @@ static struct policydb_compat_info *policydb_lookup_compat(int version)
*/ */
int roles_init(struct policydb *p) int roles_init(struct policydb *p)
{ {
char *key = 0; char *key = NULL;
int rc; int rc;
struct role_datum *role; struct role_datum *role;
...@@ -402,7 +402,7 @@ static int common_destroy(void *key, void *datum, void *p) ...@@ -402,7 +402,7 @@ static int common_destroy(void *key, void *datum, void *p)
kfree(key); kfree(key);
comdatum = datum; comdatum = datum;
hashtab_map(comdatum->permissions.table, perm_destroy, 0); hashtab_map(comdatum->permissions.table, perm_destroy, NULL);
hashtab_destroy(comdatum->permissions.table); hashtab_destroy(comdatum->permissions.table);
kfree(datum); kfree(datum);
return 0; return 0;
...@@ -416,7 +416,7 @@ static int class_destroy(void *key, void *datum, void *p) ...@@ -416,7 +416,7 @@ static int class_destroy(void *key, void *datum, void *p)
kfree(key); kfree(key);
cladatum = datum; cladatum = datum;
hashtab_map(cladatum->permissions.table, perm_destroy, 0); hashtab_map(cladatum->permissions.table, perm_destroy, NULL);
hashtab_destroy(cladatum->permissions.table); hashtab_destroy(cladatum->permissions.table);
constraint = cladatum->constraints; constraint = cladatum->constraints;
while (constraint) { while (constraint) {
...@@ -498,7 +498,7 @@ void policydb_destroy(struct policydb *p) ...@@ -498,7 +498,7 @@ void policydb_destroy(struct policydb *p)
int i; int i;
for (i = 0; i < SYM_NUM; i++) { for (i = 0; i < SYM_NUM; i++) {
hashtab_map(p->symtab[i].table, destroy_f[i], 0); hashtab_map(p->symtab[i].table, destroy_f[i], NULL);
hashtab_destroy(p->symtab[i].table); hashtab_destroy(p->symtab[i].table);
} }
...@@ -669,7 +669,7 @@ static int context_read_and_validate(struct context *c, ...@@ -669,7 +669,7 @@ static int context_read_and_validate(struct context *c,
static int perm_read(struct policydb *p, struct hashtab *h, void *fp) static int perm_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct perm_datum *perdatum; struct perm_datum *perdatum;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
...@@ -718,7 +718,7 @@ static int perm_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -718,7 +718,7 @@ static int perm_read(struct policydb *p, struct hashtab *h, void *fp)
static int common_read(struct policydb *p, struct hashtab *h, void *fp) static int common_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct common_datum *comdatum; struct common_datum *comdatum;
u32 *buf, len, nel; u32 *buf, len, nel;
int i, rc; int i, rc;
...@@ -776,7 +776,7 @@ static int common_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -776,7 +776,7 @@ static int common_read(struct policydb *p, struct hashtab *h, void *fp)
static int class_read(struct policydb *p, struct hashtab *h, void *fp) static int class_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct class_datum *cladatum; struct class_datum *cladatum;
struct constraint_node *c, *lc; struct constraint_node *c, *lc;
struct constraint_expr *e, *le; struct constraint_expr *e, *le;
...@@ -943,7 +943,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -943,7 +943,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp)
static int role_read(struct policydb *p, struct hashtab *h, void *fp) static int role_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct role_datum *role; struct role_datum *role;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
...@@ -1008,7 +1008,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -1008,7 +1008,7 @@ static int role_read(struct policydb *p, struct hashtab *h, void *fp)
static int type_read(struct policydb *p, struct hashtab *h, void *fp) static int type_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct type_datum *typdatum; struct type_datum *typdatum;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
...@@ -1055,7 +1055,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp) ...@@ -1055,7 +1055,7 @@ static int type_read(struct policydb *p, struct hashtab *h, void *fp)
static int user_read(struct policydb *p, struct hashtab *h, void *fp) static int user_read(struct policydb *p, struct hashtab *h, void *fp)
{ {
char *key = 0; char *key = NULL;
struct user_datum *usrdatum; struct user_datum *usrdatum;
int rc; int rc;
u32 *buf, len; u32 *buf, len;
......
...@@ -308,7 +308,7 @@ int security_compute_av(u32 ssid, ...@@ -308,7 +308,7 @@ int security_compute_av(u32 ssid,
u32 requested, u32 requested,
struct av_decision *avd) struct av_decision *avd)
{ {
struct context *scontext = 0, *tcontext = 0; struct context *scontext = NULL, *tcontext = NULL;
int rc = 0; int rc = 0;
if (!ss_initialized) { if (!ss_initialized) {
...@@ -355,7 +355,7 @@ int context_struct_to_string(struct context *context, char **scontext, u32 *scon ...@@ -355,7 +355,7 @@ int context_struct_to_string(struct context *context, char **scontext, u32 *scon
{ {
char *scontextp; char *scontextp;
*scontext = 0; *scontext = NULL;
*scontext_len = 0; *scontext_len = 0;
/* Compute the size of the context. */ /* Compute the size of the context. */
...@@ -600,8 +600,8 @@ static int security_compute_sid(u32 ssid, ...@@ -600,8 +600,8 @@ static int security_compute_sid(u32 ssid,
u32 specified, u32 specified,
u32 *out_sid) u32 *out_sid)
{ {
struct context *scontext = 0, *tcontext = 0, newcontext; struct context *scontext = NULL, *tcontext = NULL, newcontext;
struct role_trans *roletr = 0; struct role_trans *roletr = NULL;
struct avtab_key avkey; struct avtab_key avkey;
struct avtab_datum *avdatum; struct avtab_datum *avdatum;
struct avtab_node *node; struct avtab_node *node;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment