diff options
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r-- | drivers/scsi/dpt_i2o.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index b0c576f84b28..ffc1edf5e80d 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -1290,7 +1290,7 @@ static int adpt_i2o_post_wait(adpt_hba* pHba, u32* msg, int len, int timeout) | |||
1290 | ulong flags = 0; | 1290 | ulong flags = 0; |
1291 | struct adpt_i2o_post_wait_data *p1, *p2; | 1291 | struct adpt_i2o_post_wait_data *p1, *p2; |
1292 | struct adpt_i2o_post_wait_data *wait_data = | 1292 | struct adpt_i2o_post_wait_data *wait_data = |
1293 | kmalloc(sizeof(struct adpt_i2o_post_wait_data),GFP_KERNEL); | 1293 | kmalloc(sizeof(struct adpt_i2o_post_wait_data), GFP_ATOMIC); |
1294 | DECLARE_WAITQUEUE(wait, current); | 1294 | DECLARE_WAITQUEUE(wait, current); |
1295 | 1295 | ||
1296 | if (!wait_data) | 1296 | if (!wait_data) |
@@ -2640,6 +2640,13 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2640 | continue; | 2640 | continue; |
2641 | } | 2641 | } |
2642 | bus_no = buf[0]>>16; | 2642 | bus_no = buf[0]>>16; |
2643 | if (bus_no >= MAX_CHANNEL) { /* Something wrong skip it */ | ||
2644 | printk(KERN_WARNING | ||
2645 | "%s: Channel number %d out of range\n", | ||
2646 | pHba->name, bus_no); | ||
2647 | continue; | ||
2648 | } | ||
2649 | |||
2643 | scsi_id = buf[1]; | 2650 | scsi_id = buf[1]; |
2644 | scsi_lun = (buf[2]>>8 )&0xff; | 2651 | scsi_lun = (buf[2]>>8 )&0xff; |
2645 | pDev = pHba->channel[bus_no].device[scsi_id]; | 2652 | pDev = pHba->channel[bus_no].device[scsi_id]; |
@@ -2651,7 +2658,8 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2651 | pDev = pDev->next_lun; | 2658 | pDev = pDev->next_lun; |
2652 | } | 2659 | } |
2653 | if(!pDev ) { // Something new add it | 2660 | if(!pDev ) { // Something new add it |
2654 | d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL); | 2661 | d = kmalloc(sizeof(struct i2o_device), |
2662 | GFP_ATOMIC); | ||
2655 | if(d==NULL) | 2663 | if(d==NULL) |
2656 | { | 2664 | { |
2657 | printk(KERN_CRIT "Out of memory for I2O device data.\n"); | 2665 | printk(KERN_CRIT "Out of memory for I2O device data.\n"); |
@@ -2667,13 +2675,11 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2667 | adpt_i2o_report_hba_unit(pHba, d); | 2675 | adpt_i2o_report_hba_unit(pHba, d); |
2668 | adpt_i2o_install_device(pHba, d); | 2676 | adpt_i2o_install_device(pHba, d); |
2669 | 2677 | ||
2670 | if(bus_no >= MAX_CHANNEL) { // Something wrong skip it | ||
2671 | printk(KERN_WARNING"%s: Channel number %d out of range \n", pHba->name, bus_no); | ||
2672 | continue; | ||
2673 | } | ||
2674 | pDev = pHba->channel[bus_no].device[scsi_id]; | 2678 | pDev = pHba->channel[bus_no].device[scsi_id]; |
2675 | if( pDev == NULL){ | 2679 | if( pDev == NULL){ |
2676 | pDev = kzalloc(sizeof(struct adpt_device),GFP_KERNEL); | 2680 | pDev = |
2681 | kzalloc(sizeof(struct adpt_device), | ||
2682 | GFP_ATOMIC); | ||
2677 | if(pDev == NULL) { | 2683 | if(pDev == NULL) { |
2678 | return -ENOMEM; | 2684 | return -ENOMEM; |
2679 | } | 2685 | } |
@@ -2682,7 +2688,9 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2682 | while (pDev->next_lun) { | 2688 | while (pDev->next_lun) { |
2683 | pDev = pDev->next_lun; | 2689 | pDev = pDev->next_lun; |
2684 | } | 2690 | } |
2685 | pDev = pDev->next_lun = kzalloc(sizeof(struct adpt_device),GFP_KERNEL); | 2691 | pDev = pDev->next_lun = |
2692 | kzalloc(sizeof(struct adpt_device), | ||
2693 | GFP_ATOMIC); | ||
2686 | if(pDev == NULL) { | 2694 | if(pDev == NULL) { |
2687 | return -ENOMEM; | 2695 | return -ENOMEM; |
2688 | } | 2696 | } |
@@ -3127,7 +3135,7 @@ static int adpt_i2o_lct_get(adpt_hba* pHba) | |||
3127 | if (pHba->lct == NULL) { | 3135 | if (pHba->lct == NULL) { |
3128 | pHba->lct = dma_alloc_coherent(&pHba->pDev->dev, | 3136 | pHba->lct = dma_alloc_coherent(&pHba->pDev->dev, |
3129 | pHba->lct_size, &pHba->lct_pa, | 3137 | pHba->lct_size, &pHba->lct_pa, |
3130 | GFP_KERNEL); | 3138 | GFP_ATOMIC); |
3131 | if(pHba->lct == NULL) { | 3139 | if(pHba->lct == NULL) { |
3132 | printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n", | 3140 | printk(KERN_CRIT "%s: Lct Get failed. Out of memory.\n", |
3133 | pHba->name); | 3141 | pHba->name); |