Browse Source

[qib7322] Fix uninitialized variables warning

Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Shao Miller 14 years ago
parent
commit
4a39717e17
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      src/drivers/infiniband/qib7322.c

+ 10
- 3
src/drivers/infiniband/qib7322.c View File

657
 					  QIB7322_SMALL_SEND_BUF_SIZE,
657
 					  QIB7322_SMALL_SEND_BUF_SIZE,
658
 					  QIB7322_SMALL_SEND_BUF_START,
658
 					  QIB7322_SMALL_SEND_BUF_START,
659
 					  QIB7322_SMALL_SEND_BUF_USED );
659
 					  QIB7322_SMALL_SEND_BUF_USED );
660
-	if ( ! qib7322->send_bufs_small )
660
+	if ( ! qib7322->send_bufs_small ) {
661
+		rc = -ENOMEM;
661
 		goto err_create_send_bufs_small;
662
 		goto err_create_send_bufs_small;
663
+	}
662
 	qib7322->send_bufs_vl15_port0 =
664
 	qib7322->send_bufs_vl15_port0 =
663
 		qib7322_create_send_bufs ( qib7322, baseaddr_vl15_port0,
665
 		qib7322_create_send_bufs ( qib7322, baseaddr_vl15_port0,
664
 					  QIB7322_VL15_PORT0_SEND_BUF_SIZE,
666
 					  QIB7322_VL15_PORT0_SEND_BUF_SIZE,
665
 					  QIB7322_VL15_PORT0_SEND_BUF_START,
667
 					  QIB7322_VL15_PORT0_SEND_BUF_START,
666
 					  QIB7322_VL15_PORT0_SEND_BUF_COUNT );
668
 					  QIB7322_VL15_PORT0_SEND_BUF_COUNT );
667
-	if ( ! qib7322->send_bufs_vl15_port0 )
669
+	if ( ! qib7322->send_bufs_vl15_port0 ) {
670
+		rc = -ENOMEM;
668
 		goto err_create_send_bufs_vl15_port0;
671
 		goto err_create_send_bufs_vl15_port0;
672
+	}
669
 	qib7322->send_bufs_vl15_port1 =
673
 	qib7322->send_bufs_vl15_port1 =
670
 		qib7322_create_send_bufs ( qib7322, baseaddr_vl15_port1,
674
 		qib7322_create_send_bufs ( qib7322, baseaddr_vl15_port1,
671
 					  QIB7322_VL15_PORT1_SEND_BUF_SIZE,
675
 					  QIB7322_VL15_PORT1_SEND_BUF_SIZE,
672
 					  QIB7322_VL15_PORT1_SEND_BUF_START,
676
 					  QIB7322_VL15_PORT1_SEND_BUF_START,
673
 					  QIB7322_VL15_PORT1_SEND_BUF_COUNT );
677
 					  QIB7322_VL15_PORT1_SEND_BUF_COUNT );
674
-	if ( ! qib7322->send_bufs_vl15_port1 )
678
+	if ( ! qib7322->send_bufs_vl15_port1 ) {
679
+		rc = -ENOMEM;
675
 		goto err_create_send_bufs_vl15_port1;
680
 		goto err_create_send_bufs_vl15_port1;
681
+	}
676
 
682
 
677
 	/* Allocate space for the SendBufAvail array */
683
 	/* Allocate space for the SendBufAvail array */
678
 	qib7322->sendbufavail = malloc_dma ( sizeof ( *qib7322->sendbufavail ),
684
 	qib7322->sendbufavail = malloc_dma ( sizeof ( *qib7322->sendbufavail ),
1681
 	default:
1687
 	default:
1682
 		DBGC ( qib7322, "QIB7322 %p port %d is invalid\n",
1688
 		DBGC ( qib7322, "QIB7322 %p port %d is invalid\n",
1683
 		       qib7322, port );
1689
 		       qib7322, port );
1690
+		supported = 0;
1684
 		break;
1691
 		break;
1685
 	}
1692
 	}
1686
 
1693
 

Loading…
Cancel
Save