aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/firewire/net.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 47dcb45d720e..a42209a73aed 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -810,29 +810,27 @@ static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r,
810 int speed, unsigned long long offset, void *payload, 810 int speed, unsigned long long offset, void *payload,
811 size_t length, void *callback_data) 811 size_t length, void *callback_data)
812{ 812{
813 struct fwnet_device *dev; 813 struct fwnet_device *dev = callback_data;
814 int status; 814 int rcode;
815 815
816 dev = callback_data; 816 if (destination == IEEE1394_ALL_NODES) {
817 if (tcode != TCODE_WRITE_BLOCK_REQUEST 817 kfree(r);
818 || destination != card->node_id /* <- FIXME */
819 || generation != card->generation /* <- FIXME */
820 || offset != dev->handler.offset) {
821 fw_send_response(card, r, RCODE_CONFLICT_ERROR);
822 818
823 return; 819 return;
824 } 820 }
825 821
826 status = fwnet_incoming_packet(dev, payload, length, 822 if (offset != dev->handler.offset)
827 source, generation, false); 823 rcode = RCODE_ADDRESS_ERROR;
828 if (status != 0) { 824 else if (tcode != TCODE_WRITE_BLOCK_REQUEST)
825 rcode = RCODE_TYPE_ERROR;
826 else if (fwnet_incoming_packet(dev, payload, length,
827 source, generation, false) != 0) {
829 fw_error("Incoming packet failure\n"); 828 fw_error("Incoming packet failure\n");
830 fw_send_response(card, r, RCODE_CONFLICT_ERROR); 829 rcode = RCODE_CONFLICT_ERROR;
831 830 } else
832 return; 831 rcode = RCODE_COMPLETE;
833 }
834 832
835 fw_send_response(card, r, RCODE_COMPLETE); 833 fw_send_response(card, r, rcode);
836} 834}
837 835
838static void fwnet_receive_broadcast(struct fw_iso_context *context, 836static void fwnet_receive_broadcast(struct fw_iso_context *context,