Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Aug 2016 15:01:39 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304605 - in head/usr.sbin: ctld iscsid
Message-ID:  <201608221501.u7MF1ddO077092@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Mon Aug 22 15:01:39 2016
New Revision: 304605
URL: https://svnweb.freebsd.org/changeset/base/304605

Log:
  Fix calloc(3) argument order.
  
  Reviewed by:	trasz
  MFC after:	4 weeks.
  Differential Revision:	https://reviews.freebsd.org/D7532

Modified:
  head/usr.sbin/ctld/chap.c
  head/usr.sbin/ctld/keys.c
  head/usr.sbin/ctld/pdu.c
  head/usr.sbin/iscsid/chap.c
  head/usr.sbin/iscsid/keys.c
  head/usr.sbin/iscsid/pdu.c

Modified: head/usr.sbin/ctld/chap.c
==============================================================================
--- head/usr.sbin/ctld/chap.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/ctld/chap.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -232,7 +232,7 @@ chap_new(void)
 {
 	struct chap *chap;
 
-	chap = calloc(sizeof(*chap), 1);
+	chap = calloc(1, sizeof(*chap));
 	if (chap == NULL)
 		log_err(1, "calloc");
 
@@ -333,7 +333,7 @@ rchap_new(const char *secret)
 {
 	struct rchap *rchap;
 
-	rchap = calloc(sizeof(*rchap), 1);
+	rchap = calloc(1, sizeof(*rchap));
 	if (rchap == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/ctld/keys.c
==============================================================================
--- head/usr.sbin/ctld/keys.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/ctld/keys.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -43,7 +43,7 @@ keys_new(void)
 {
 	struct keys *keys;
 
-	keys = calloc(sizeof(*keys), 1);
+	keys = calloc(1, sizeof(*keys));
 	if (keys == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/ctld/pdu.c
==============================================================================
--- head/usr.sbin/ctld/pdu.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/ctld/pdu.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -81,11 +81,11 @@ pdu_new(struct connection *conn)
 {
 	struct pdu *pdu;
 
-	pdu = calloc(sizeof(*pdu), 1);
+	pdu = calloc(1, sizeof(*pdu));
 	if (pdu == NULL)
 		log_err(1, "calloc");
 
-	pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1);
+	pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs));
 	if (pdu->pdu_bhs == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/chap.c
==============================================================================
--- head/usr.sbin/iscsid/chap.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/iscsid/chap.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -232,7 +232,7 @@ chap_new(void)
 {
 	struct chap *chap;
 
-	chap = calloc(sizeof(*chap), 1);
+	chap = calloc(1, sizeof(*chap));
 	if (chap == NULL)
 		log_err(1, "calloc");
 
@@ -333,7 +333,7 @@ rchap_new(const char *secret)
 {
 	struct rchap *rchap;
 
-	rchap = calloc(sizeof(*rchap), 1);
+	rchap = calloc(1, sizeof(*rchap));
 	if (rchap == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/keys.c
==============================================================================
--- head/usr.sbin/iscsid/keys.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/iscsid/keys.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -43,7 +43,7 @@ keys_new(void)
 {
 	struct keys *keys;
 
-	keys = calloc(sizeof(*keys), 1);
+	keys = calloc(1, sizeof(*keys));
 	if (keys == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/iscsid/pdu.c
==============================================================================
--- head/usr.sbin/iscsid/pdu.c	Mon Aug 22 14:53:39 2016	(r304604)
+++ head/usr.sbin/iscsid/pdu.c	Mon Aug 22 15:01:39 2016	(r304605)
@@ -81,11 +81,11 @@ pdu_new(struct connection *conn)
 {
 	struct pdu *pdu;
 
-	pdu = calloc(sizeof(*pdu), 1);
+	pdu = calloc(1, sizeof(*pdu));
 	if (pdu == NULL)
 		log_err(1, "calloc");
 
-	pdu->pdu_bhs = calloc(sizeof(*pdu->pdu_bhs), 1);
+	pdu->pdu_bhs = calloc(1, sizeof(*pdu->pdu_bhs));
 	if (pdu->pdu_bhs == NULL)
 		log_err(1, "calloc");
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608221501.u7MF1ddO077092>