On 5/6/23 4:29 PM, Chris Leech wrote:
> @@ -2857,11 +2859,17 @@ void iscsi_post_host_event(uint32_t host_no, struct
> iscsi_transport *transport,
> enum iscsi_host_event_code code, uint32_t data_size,
> uint8_t *data)
> {
> + struct Scsi_Host *shost;
> + struct net *net;
> struct nlmsghdr *nlh;
> struct sk_buff *skb;
> struct iscsi_uevent *ev;
> int len = nlmsg_total_size(sizeof(*ev) + data_size);
>
> + shost = scsi_host_lookup(host_no);
> + if (!shost)
> + return;
> +
> skb = alloc_skb(len, GFP_NOIO);
> if (!skb) {
Need scsi_host_put. Maybe just grab the net and do the put before the alloc_skb.
> printk(KERN_ERR "gracefully ignored host event (%d):%d OOM\n",
> @@ -2880,7 +2888,9 @@ void iscsi_post_host_event(uint32_t host_no, struct
> iscsi_transport *transport,
> if (data_size)
> memcpy((char *)ev + sizeof(*ev), data, data_size);
>
> - iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO);
> + net = iscsi_host_net(shost->shost_data);
> + scsi_host_put(shost);
> + iscsi_multicast_skb(net, skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO);
> }
> EXPORT_SYMBOL_GPL(iscsi_post_host_event);
>
> @@ -2888,11 +2898,17 @@ void iscsi_ping_comp_event(uint32_t host_no, struct
> iscsi_transport *transport,
> uint32_t status, uint32_t pid, uint32_t data_size,
> uint8_t *data)
> {
> + struct Scsi_Host *shost;
> + struct net *net;
> struct nlmsghdr *nlh;
> struct sk_buff *skb;
> struct iscsi_uevent *ev;
> int len = nlmsg_total_size(sizeof(*ev) + data_size);
>
> + shost = scsi_host_lookup(host_no);
> + if (!shost)
> + return;
> +
> skb = alloc_skb(len, GFP_NOIO);
> if (!skb) {
Same as above.
--
You received this message because you are subscribed to the Google Groups
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/open-iscsi/56fad7cf-1bf4-82a1-2acc-53a5fc7f9c70%40oracle.com.