kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: staging: goldfish: Fix pointer cast for 32 bits
@ 2016-04-13  6:40 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-04-13  6:40 UTC (permalink / raw)
  To: kernel-janitors

Hello Peter Senna Tschudin,

The patch 07d783fd830a: "staging: goldfish: Fix pointer cast for 32
bits" from May 19, 2015, leads to the following static checker
warning:

	drivers/tty/goldfish.c:83 goldfish_tty_interrupt()
	error: XXX uninitialized symbol 'buf'.

drivers/tty/goldfish.c
    69  static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
    70  {
    71          struct goldfish_tty *qtty = dev_id;
    72          void __iomem *base = qtty->base;
    73          unsigned long irq_flags;
    74          unsigned char *buf;
    75          u32 count;
    76  
    77          count = readl(base + GOLDFISH_TTY_BYTES_READY);
    78          if (count = 0)
    79                  return IRQ_NONE;
    80  
    81          count = tty_prepare_flip_string(&qtty->port, &buf, count);

If tty_prepare_flip_string() returns size zero because there is no space
then "buf" is uninitialized.

    82          spin_lock_irqsave(&qtty->lock, irq_flags);
    83          gf_write_ptr(buf, base + GOLDFISH_TTY_DATA_PTR,
    84                                  base + GOLDFISH_TTY_DATA_PTR_HIGH);
    85          writel(count, base + GOLDFISH_TTY_DATA_LEN);
    86          writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD);
    87          spin_unlock_irqrestore(&qtty->lock, irq_flags);
    88          tty_schedule_flip(&qtty->port);
    89          return IRQ_HANDLED;
    90  }


regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-13  6:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-13  6:40 staging: goldfish: Fix pointer cast for 32 bits Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).