Showing error 849

User: Jiri Slaby
Error type: Resource Leak
Error type description: The code omits to put the resource to the system for reuse
File location: drivers/video/vermilion/cr_pll.c
Line in file: 159
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2011-11-07 22:40:13 UTC


Source:

129        u32 clock_val;
130
131        index = crvml_nearest_index(sys, clock);
132
133        if (crvml_clocks[index] != clock)
134                return -EINVAL;
135
136        clock_val = ioread32(clock_reg) & ~CRVML_CLOCK_MASK;
137        clock_val = crvml_clock_bits[index] << CRVML_CLOCK_SHIFT;
138        iowrite32(clock_val, clock_reg);
139        ioread32(clock_reg);
140
141        return 0;
142}
143
144static struct vml_sys cr_pll_ops = {
145        .name = "Carillo Ranch",
146        .save = crvml_sys_save,
147        .restore = crvml_sys_restore,
148        .set_clock = crvml_set_clock,
149        .nearest_clock = crvml_nearest_clock,
150};
151
152static int __init cr_pll_init(void)
153{
154        int err;
155        u32 dev_en;
156
157        mch_dev = pci_get_device(PCI_VENDOR_ID_INTEL,
158                                        CRVML_DEVICE_MCH, NULL);
159        if (!mch_dev) {
160                printk(KERN_ERR
161                       "Could not find Carillo Ranch MCH device.\n");
162                return -ENODEV;
163        }
164
165        pci_read_config_dword(mch_dev, CRVML_REG_MCHEN, &dev_en);
166        if (!(dev_en & CRVML_MCHEN_BIT)) {
167                printk(KERN_ERR
168                       "Carillo Ranch MCH device was not enabled.\n");
169                pci_dev_put(mch_dev);
Show full sources