[PATCH 33/39] pcmcia: deprecate CS_BAD_BASE, CS_BAD_IRQ, CS_BAD_OFFSET and CS_BAD_SIZE

Dominik Brodowski linux at dominikbrodowski.net
Thu Aug 21 17:33:27 EDT 2008


Larry,

On Tue, Aug 19, 2008 at 10:59:30PM -0500, Larry Finger wrote:
> Dominik Brodowski wrote:
> 
> This routine generates a warning thar "s" is used uninitialized. 
> Routine pcmcia_map_mem_page should be
> 
> int pcmcia_map_mem_page(window_handle_t win, memreq_t *req)
> {
>         struct pcmcia_socket *s;
>         if ((win == NULL) || (win->magic != WINDOW_MAGIC))
>                 return -EINVAL;
>         s = win->sock;
>         if (req->Page != 0) {
>                 ds_dbg(s, 0, "failure: requested page is zero\n");
>                 return -EINVAL;
>         }
>         win->ctl.card_start = req->CardOffset;
>         if (s->ops->set_mem_map(s, &win->ctl) != 0) {
>                 ds_dbg(s, 0, "failed to set_mem_map\n");
>                 return -EIO;
>         }
>         return 0;
> } /* pcmcia_map_mem_page */
> EXPORT_SYMBOL(pcmcia_map_mem_page);
> 
> The fix is to put the line "s = win->sock" ahead of the "if (req->Page 
> != 0)" statement.

good catch. Fixed in current tip, and again the bugfix will likely by
squashed to the original patch.

Best,
	Dominik



More information about the linux-pcmcia mailing list