pntsd is never NULL here, and get rid of extra "else" that adds some unneeded indentation. Signed-off-by: Jeff Layton <jlayton@xxxxxxxxx> --- setcifsacl.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/setcifsacl.c b/setcifsacl.c index e97a35f..380adac 100644 --- a/setcifsacl.c +++ b/setcifsacl.c @@ -329,19 +329,16 @@ get_numfaces(struct cifs_ntsd *pntsd, ssize_t acl_len, struct cifs_ctrl_acl *ldaclptr; char *end_of_acl = ((char *)pntsd) + acl_len; - if (pntsd == NULL) - return 0; - dacloffset = le32toh(pntsd->dacloffset); if (!dacloffset) return 0; - else { - ldaclptr = (struct cifs_ctrl_acl *)((char *)pntsd + dacloffset); - /* validate that we do not go past end of acl */ - if (end_of_acl >= (char *)ldaclptr + le16toh(ldaclptr->size)) { - numfaces = le32toh(ldaclptr->num_aces); - *daclptr = ldaclptr; - } + + ldaclptr = (struct cifs_ctrl_acl *)((char *)pntsd + dacloffset); + + /* validate that we do not go past end of acl */ + if (end_of_acl >= (char *)ldaclptr + le16toh(ldaclptr->size)) { + numfaces = le32toh(ldaclptr->num_aces); + *daclptr = ldaclptr; } return numfaces; -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html