aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvirupaxs <virupax.sadashivpetimath@stericsson.com>2010-03-15 13:55:24 +0530
committerJohn Rigby <john.rigby@linaro.org>2010-09-02 22:44:40 -0600
commitc1d510da775becd22e13a527106aef4acb201e90 (patch)
tree22cd2d7ada601236d0e8d64830b2344377ba2f56
parent6d5f937af6128496bd19725f9e38926373c3ddba (diff)
downloadlinux-2.6.34-ux500-c1d510da775becd22e13a527106aef4acb201e90.tar.gz
coverity fixes 18th march
Signed-off-by: virupaxs <virupax.sadashivpetimath@stericsson.com>
-rwxr-xr-xarch/arm/mach-ux500/dma_40.c3
-rwxr-xr-xarch/arm/mach-ux500/prcmu-fw.c3
-rw-r--r--drivers/gpio/stm_gpio.c7
-rw-r--r--drivers/i2c/busses/i2c-stm.c3
-rw-r--r--drivers/input/keyboard/u8500-kpd.c2
-rw-r--r--drivers/misc/i2s/i2s_test_protocol_driver.c3
-rw-r--r--drivers/misc/i2s/msp_i2s.c5
-rw-r--r--drivers/usb/musb/stm_musb.c26
8 files changed, 41 insertions, 11 deletions
diff --git a/arch/arm/mach-ux500/dma_40.c b/arch/arm/mach-ux500/dma_40.c
index a616f592807..37de49281ff 100755
--- a/arch/arm/mach-ux500/dma_40.c
+++ b/arch/arm/mach-ux500/dma_40.c
@@ -3219,6 +3219,9 @@ int stm_dma_residue(int pipe_id)
params = ((void *)
(dma_drv_data->lchan_params_base.log_addr)
+ (info->src_dev_type * 32));
+ else
+ return remaining;
+
remaining =
MEM_READ_BITS(params->dmac_lcsp2, MEM_LCSP2_ECNT_MASK,
MEM_LCSP2_ECNT_POS);
diff --git a/arch/arm/mach-ux500/prcmu-fw.c b/arch/arm/mach-ux500/prcmu-fw.c
index 44208066790..f6a6cdcf3c3 100755
--- a/arch/arm/mach-ux500/prcmu-fw.c
+++ b/arch/arm/mach-ux500/prcmu-fw.c
@@ -1394,9 +1394,6 @@ int prcmu_apply_ap_state_transition(enum ap_pwrst_trans_t transition,
printk(KERN_INFO "u8500-prcm : Woken from Sleep OK\n");
break;
-
- printk(KERN_INFO "TODO: deep sleep \n");
- break;
case APBOOT_TO_APEXECUTE:
break;
default:
diff --git a/drivers/gpio/stm_gpio.c b/drivers/gpio/stm_gpio.c
index 5d1b7eadb86..89cc49d7fb4 100644
--- a/drivers/gpio/stm_gpio.c
+++ b/drivers/gpio/stm_gpio.c
@@ -429,6 +429,7 @@ static unsigned int gpio_irq_startup(unsigned int irq)
const char *owner_name;
struct stm_gpio *gpio_s = get_irq_chip_data(irq);
int offset = IRQ_TO_GPIO(irq) - gpio_s->chip.base;
+ int status = 0;
void __iomem *regs;
u32 mask = gpio_get_regs_and_mask(IRQ_TO_GPIO(irq), &regs);
@@ -447,7 +448,11 @@ static unsigned int gpio_irq_startup(unsigned int irq)
}
/* allocate GPIO line used for this IRQ */
- gpio_request(IRQ_TO_GPIO(irq), "IRQ");
+ status = gpio_request(IRQ_TO_GPIO(irq), "IRQ");
+ if (status < 0) {
+ printk(KERN_ERR "failed to get the requested gpio\n");
+ return status;
+ }
/* pull-up/down off, input, software mode, interrupts masked */
writel(readl(regs + GPIO_AFSA) & ~mask, regs + GPIO_AFSA);
diff --git a/drivers/i2c/busses/i2c-stm.c b/drivers/i2c/busses/i2c-stm.c
index ab6a84506ec..6abaeeaed4a 100644
--- a/drivers/i2c/busses/i2c-stm.c
+++ b/drivers/i2c/busses/i2c-stm.c
@@ -671,6 +671,7 @@ init_completion(&priv->xfer_complete);
{
stm_error("DMA mode not supported...\n");
status = -EINVAL;
+ break;
}
default:
{
@@ -764,6 +765,8 @@ static int stm_i2c_xfer(struct i2c_adapter *i2c_adap,
if (priv->clk)
clk_enable(priv->clk);
+ else
+ return -EINVAL;
if (reset_i2c_controller(priv))
return -1;
diff --git a/drivers/input/keyboard/u8500-kpd.c b/drivers/input/keyboard/u8500-kpd.c
index e3b8a145deb..999261a4de4 100644
--- a/drivers/input/keyboard/u8500-kpd.c
+++ b/drivers/input/keyboard/u8500-kpd.c
@@ -304,7 +304,9 @@ static int __init u8500_kp_probe(struct platform_device *pdev)
KEYPAD_VER_X, KEYPAD_VER_Y, KEYPAD_VER_Z);
return 0;
+#if 0
err_req_irq:
+#endif
err_inp_reg:
/* unregistering device */
input_unregister_device(kp->inp_dev);
diff --git a/drivers/misc/i2s/i2s_test_protocol_driver.c b/drivers/misc/i2s/i2s_test_protocol_driver.c
index 4aefc99b80e..7f16cf371eb 100644
--- a/drivers/misc/i2s/i2s_test_protocol_driver.c
+++ b/drivers/misc/i2s/i2s_test_protocol_driver.c
@@ -200,7 +200,8 @@ static int i2sdrv_probe(struct i2s_device *i2s)
/* Allocate driver data */
- try_module_get(i2s->controller->dev.parent->driver->owner);
+ if (!try_module_get(i2s->controller->dev.parent->driver->owner))
+ return -ENOENT;
i2sdrv[i2s->chip_select] = kzalloc(sizeof(*i2sdrv[i2s->chip_select]), GFP_KERNEL);
if (!i2sdrv[i2s->chip_select])
return -ENOMEM;
diff --git a/drivers/misc/i2s/msp_i2s.c b/drivers/misc/i2s/msp_i2s.c
index a66ca040d4d..2e28bc95111 100644
--- a/drivers/misc/i2s/msp_i2s.c
+++ b/drivers/misc/i2s/msp_i2s.c
@@ -484,8 +484,7 @@ static int configure_multichannel(struct msp_struct *msp,
struct msp_protocol_desc *protocol_desc;
t_msp_multichannel_config *mult_config;
if (config->default_protocol_desc == 1) {
- if ((config->protocol < 0)
- || (config->protocol >= MSP_INVALID_PROTOCOL)) {
+ if (config->protocol >= MSP_INVALID_PROTOCOL) {
printk(KERN_ERR
"invalid protocol in configure_protocol()\n");
return -EINVAL;
@@ -1495,7 +1494,7 @@ static int stm_msp_disable(struct msp_struct *msp, int direction, i2s_flag flag)
stm_msp_write((stm_msp_read(msp->registers + MSP_GCR) &
(~(FRAME_GEN_ENABLE | SRG_ENABLE))),
msp->registers + MSP_GCR);
- memset(&msp->xfer_data, sizeof(struct trans_data), 0);
+ memset(&msp->xfer_data, 0, sizeof(struct trans_data));
if (msp->plat_exit) {
status = msp->plat_exit(msp->gpio_alt_func);
if (status)
diff --git a/drivers/usb/musb/stm_musb.c b/drivers/usb/musb/stm_musb.c
index 2ec68b9f949..fffd0d58fea 100644
--- a/drivers/usb/musb/stm_musb.c
+++ b/drivers/usb/musb/stm_musb.c
@@ -427,7 +427,14 @@ int __init musb_platform_init(struct musb *musb)
val = ab8500_read(AB8500_INTERRUPT, AB8500_IT_MASK20_REG);
ab8500_write(AB8500_INTERRUPT, AB8500_IT_MASK20_REG, AB8500_IT_MASK20_MASK);
val = ab8500_read(AB8500_INTERRUPT, AB8500_IT_MASK20_REG);
- ab8500_set_callback_handler(AB8500_ID_WAKEUP, usb_host_detect_handler, NULL);
+ ret = ab8500_set_callback_handler(AB8500_ID_WAKEUP,
+ usb_host_detect_handler, NULL);
+ if (ret < 0) {
+ printk(KERN_ERR "failed to set callback handler"
+ " for usb host detection\n");
+ return ret;
+ }
+
} else {
#ifndef CONFIG_USB_SERIAL
val = ab8500_read(AB8500_REGU_CTRL1, AB8500_REGU_OTGSUPPLY_CTRL_REG);
@@ -438,8 +445,21 @@ int __init musb_platform_init(struct musb *musb)
#else
if ((ab8500_rev == AB8500_REV_10) || (ab8500_rev == AB8500_REV_11)) {
ab8500_write(AB8500_INTERRUPT, AB8500_IT_MASK2_REG, AB8500_IT_MASK2_MASK);
- ab8500_set_callback_handler(AB8500_VBUS_RISING, usb_device_detect_handler, NULL);
- ab8500_set_callback_handler(AB8500_VBUS_FALLING, usb_device_remove_handler, NULL);
+ ret = ab8500_set_callback_handler(AB8500_VBUS_RISING,
+ usb_device_detect_handler, NULL);
+ if (ret < 0) {
+ printk(KERN_ERR "failed to set callback handler"
+ " for usb device detection\n");
+ return ret;
+ }
+ ret = ab8500_set_callback_handler(AB8500_VBUS_FALLING,
+ usb_device_remove_handler, NULL);
+ if (ret < 0) {
+ printk(KERN_ERR "failed to set the callback"
+ " handler for usb device"
+ " removal\n");
+ return ret;
+ }
}
#endif