linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Huacai Chen <chenhc@lemote.com>
Cc: linux-kernel@vger.kernel.org, Fuxin Zhang <zhangfx@lemote.com>,
	Zhangjin Wu <wuzhangjin@gmail.com>,
	stable@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Michael Hernandez <michael.hernandez@cavium.com>
Subject: Re: [PATCH] genirq/affinity: Assign default affinity to pre/post vectors
Date: Tue, 15 Jan 2019 20:10:53 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1901151959060.1655@nanos.tec.linutronix.de> (raw)
In-Reply-To: <1546225404-6775-1-git-send-email-chenhc@lemote.com>

On Mon, 31 Dec 2018, Huacai Chen wrote:

> Generally, irq_create_affinity_masks() assign default affinity to pre/
> post vectors correctly. However, it ignore the case that there are only
> pre/post vectors (when nvecs == affd->pre_vectors + affd->post_vectors)
> and return NULL. This case usually happens when nvecs = 1 (e.g. in nvme
> driver when MSI-X is unavailable and fallback to MSI) and will trigger
> the warning in pci_irq_get_affinity(). This patch fix the corner case.

Errm. This is just wrong. When this function returns NULL, then it has
failed and the caller or any subsequent code is not supposed to use the
result.

The function can return NULL for other reasons, e.g. when the memory
allocation failed. How are you going to duct tape that one?

Thanks,

	tglx

  reply	other threads:[~2019-01-15 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-31  3:03 [PATCH] genirq/affinity: Assign default affinity to pre/post vectors Huacai Chen
2019-01-15 19:10 ` Thomas Gleixner [this message]
2019-01-16  3:00   ` 陈华才
2019-01-16  9:26     ` Thomas Gleixner
2019-01-17  1:14       ` 陈华才
2019-01-18  1:52         ` Huacai Chen
2019-01-22 21:04           ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1901151959060.1655@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=chenhc@lemote.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hernandez@cavium.com \
    --cc=stable@vger.kernel.org \
    --cc=wuzhangjin@gmail.com \
    --cc=zhangfx@lemote.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).