net: ceph: fix ->monmap and err initialization
Subsystems (3)
PATCH 1/1 net: ceph: fix ->monmap and err initialization
From: Jean Sacren <[email protected]>
Call to build_initial_monmap() is one stone two birds. Explicitly it initializes err variable. Implicitly it initializes ->monmap via call to kzalloc(). We should only declare err and ->monmap is taken care of by ceph_monc_init() prototype.
Signed-off-by Jean Sacren <[email protected]>
--- net/ceph/mon_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/ceph/mon_client.c +1 -2
@@ -1153,12 +1153,11 @@ static int build_initial_monmap(struct ceph_mon_client *monc)int ceph_monc_init (struct ceph_mon_client *monc,struct ceph_client *cl) { -int err =0 ; +int err;dout ("init\n" );memset (monc,0 ,sizeof (*monc)); monc->client = cl; - monc->monmap =NULL ;mutex_init (&monc->mutex); err =build_initial_monmap (monc);
Quoted 21 lines · Jεan Sacren
From: Jean Sacren <[email protected]>
Call to
build_initial_monmap()is one stone two birds. Explicitly it initializes err variable. Implicitly it initializes ->monmap via call tokzalloc(). We should only declare err and ->monmap is taken care of byceph_monc_init()prototype.Signed-off-by Jean Sacren <[email protected]>--- net/ceph/mon_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)net/ceph/mon_client.c +0
-0@@ -1153,12 +1153,11 @@ static int build_initial_monmap(struct ceph_mon_client *monc)int ceph_monc_init (struct ceph_mon_client *monc,struct ceph_client *cl) {
net/ceph/mon_client.c static int build_initial_monmap(struct ceph_mon_client *monc) · line 1163
Quoted 10 lines
net/ceph/mon_client.c +1
-2-int err =0 ; +int err;dout ("init\n" );memset (monc,0 ,sizeof (*monc)); monc->client = cl; - monc->monmap =NULL ;mutex_init (&monc->mutex); err =build_initial_monmap (monc);
Applied.
Thanks,
Ilya